fix(nvim): restore treesitter textobjects config
This commit is contained in:
parent
df62544cd1
commit
70ec13162c
@ -42,6 +42,57 @@ nvim_treesitter.setup({
|
||||
end,
|
||||
},
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
disable = function(lang, bufnr)
|
||||
local mode = vim.fn.mode()
|
||||
if mode == "c" then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
keymaps = {
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
["ib"] = "@block.inner",
|
||||
["ab"] = "@block.outer",
|
||||
["as"] = { query = "@scope", query_group = "locals", desc = "Select language scope" },
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
disable = function(lang, bufnr)
|
||||
local mode = vim.fn.mode()
|
||||
if mode == "c" then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
set_jumps = true,
|
||||
goto_next_start = {
|
||||
["]fs"] = "@function.outer",
|
||||
["]cs"] = "@class.outer",
|
||||
["]bs"] = "@block.outer",
|
||||
},
|
||||
goto_next_end = {
|
||||
["]fe"] = "@function.outer",
|
||||
["]ce"] = "@class.outer",
|
||||
["]be"] = "@block.outer",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[fs"] = "@function.outer",
|
||||
["[cs"] = "@class.outer",
|
||||
["[bs"] = "@block.outer",
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[fe"] = "@function.outer",
|
||||
["[ce"] = "@class.outer",
|
||||
["[bs"] = "@block.outer",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("treesitter-context").setup({})
|
||||
|
Loading…
Reference in New Issue
Block a user