Skip to content

Commit f0036e2

Browse files
authored
docs: vim.g.no_plugin_maps to avoid conflicts
1 parent 76deedf commit f0036e2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ require("nvim-treesitter-textobjects").setup {
6464

6565
-- keymaps
6666
-- You can use the capture groups defined in `textobjects.scm`
67-
vim.keymap.set({ "x", "o" }, "af", function()
67+
vim.keymap.set({ "x", "o" }, "am", function()
6868
require "nvim-treesitter-textobjects.select".select_textobject("@function.outer", "textobjects")
6969
end)
70-
vim.keymap.set({ "x", "o" }, "if", function()
70+
vim.keymap.set({ "x", "o" }, "im", function()
7171
require "nvim-treesitter-textobjects.select".select_textobject("@function.inner", "textobjects")
7272
end)
7373
vim.keymap.set({ "x", "o" }, "ac", function()
@@ -112,6 +112,13 @@ require("nvim-treesitter-textobjects").setup {
112112
},
113113
}
114114

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+
115122
-- keymaps
116123
-- You can use the capture groups defined in `textobjects.scm`
117124
vim.keymap.set({ "n", "x", "o" }, "]m", function()
@@ -198,8 +205,6 @@ vim.keymap.set({ "n", "x", "o" }, "<end>", function()
198205
end)
199206
```
200207

201-
For a similar way of making arbitrary movements repeatable, see [nvim-next](https://github.com/ghostbuster91/nvim-next).
202-
203208
# Overriding or extending textobjects
204209

205210
Textobjects are defined in the `textobjects.scm` files.

0 commit comments

Comments
 (0)