mirror of https://github.com/sgoudham/dotfiles.git
feat(lvim): add nvim-treesitter-textobjects
parent
ec328f2d45
commit
ffeed324db
@ -1,3 +1,47 @@
|
|||||||
lvim.builtin.treesitter.rainbow.enable = true
|
lvim.builtin.treesitter.rainbow.enable = true
|
||||||
lvim.builtin.treesitter.highlight.enable = true
|
lvim.builtin.treesitter.highlight.enable = true
|
||||||
lvim.builtin.treesitter.ensure_installed = "all"
|
lvim.builtin.treesitter.ensure_installed = "all"
|
||||||
|
lvim.builtin.treesitter.textobjects = {
|
||||||
|
select = {
|
||||||
|
enable = true,
|
||||||
|
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
||||||
|
keymaps = {
|
||||||
|
-- You can use the capture groups defined in textobjects.scm
|
||||||
|
["aa"] = "@parameter.outer",
|
||||||
|
["ia"] = "@parameter.inner",
|
||||||
|
["af"] = "@function.outer",
|
||||||
|
["if"] = "@function.inner",
|
||||||
|
["ac"] = "@class.outer",
|
||||||
|
["ic"] = "@class.inner",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
move = {
|
||||||
|
enable = true,
|
||||||
|
set_jumps = true, -- whether to set jumps in the jumplist
|
||||||
|
goto_next_start = {
|
||||||
|
["]m"] = "@function.outer",
|
||||||
|
["]]"] = "@class.outer",
|
||||||
|
},
|
||||||
|
goto_next_end = {
|
||||||
|
["]M"] = "@function.outer",
|
||||||
|
["]["] = "@class.outer",
|
||||||
|
},
|
||||||
|
goto_previous_start = {
|
||||||
|
["[m"] = "@function.outer",
|
||||||
|
["[["] = "@class.outer",
|
||||||
|
},
|
||||||
|
goto_previous_end = {
|
||||||
|
["[M"] = "@function.outer",
|
||||||
|
["[]"] = "@class.outer",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
swap = {
|
||||||
|
enable = true,
|
||||||
|
swap_next = {
|
||||||
|
["<leader>a"] = "@parameter.inner",
|
||||||
|
},
|
||||||
|
swap_previous = {
|
||||||
|
["<leader>A"] = "@parameter.inner",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue