Skip to content

Commit 54a3af1

Browse files
authored
Enhance README with keymap configuration details
Added configuration options to disable built-in keymaps for better customization.
1 parent f0036e2 commit 54a3af1

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,25 @@ You can install nvim-treesitter-textobjects with your favorite package manager,
1212

1313
### Using a package manager
1414

15-
If you are using [vim-plug](https://github.com/junegunn/vim-plug), put this in your `init.vim` file:
16-
17-
```vim
18-
Plug 'nvim-treesitter/nvim-treesitter-textobjects'
19-
```
20-
2115
If you are using [lazy.nvim](https://github.com/folke/lazy.nvim), add this to your `init.lua` or `plugins.lua`.
2216

2317
```lua
2418
{
2519
"nvim-treesitter/nvim-treesitter-textobjects",
20+
init = function()
21+
-- Disable entire built-in ftplugin mappings to avoid conflicts.
22+
-- See https://github.com/neovim/neovim/tree/master/runtime/ftplugin for built-in ftplugins.
23+
vim.g.no_plugin_maps = true
24+
25+
-- Or, disable built-in vim keymaps to avoid conflicts (add as you like)
26+
-- vim.g.no_python_maps = true
27+
-- vim.g.no_ruby_maps = true
28+
-- vim.g.no_rust_maps = true
29+
-- vim.g.no_go_maps = true
30+
end,
31+
config = function()
32+
-- put your config here
33+
end,
2634
}
2735
```
2836

@@ -112,13 +120,6 @@ require("nvim-treesitter-textobjects").setup {
112120
},
113121
}
114122

115-
-- disable built-in vim keymaps to avoid conflicts (add as you like)
116-
vim.g.no_python_maps = true
117-
vim.g.no_ruby_maps = true
118-
vim.g.no_rust_maps = true
119-
vim.g.no_go_maps = true
120-
-- vim.g.no_plugin_maps = true -- disable entire ftplugin mappings if you know what you're doing
121-
122123
-- keymaps
123124
-- You can use the capture groups defined in `textobjects.scm`
124125
vim.keymap.set({ "n", "x", "o" }, "]m", function()

0 commit comments

Comments
 (0)