home: vim: add 'treesitter-textobjects'

This commit is contained in:
Bruno BELANYI 2022-02-26 19:28:15 +01:00
parent be84a4a6fa
commit b7b3387df7
2 changed files with 19 additions and 0 deletions

View file

@ -67,6 +67,7 @@ in
lsp_lines-nvim # Show diagnostics *over* regions lsp_lines-nvim # Show diagnostics *over* regions
null-ls-nvim # LSP integration for linters and formatters null-ls-nvim # LSP integration for linters and formatters
(nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars)) # Better highlighting (nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars)) # Better highlighting
nvim-treesitter-textobjects # More textobjects
plenary-nvim # 'null-ls' dependency plenary-nvim # 'null-ls' dependency
# UX improvements # UX improvements

View file

@ -9,5 +9,23 @@ ts_config.setup({
indent = { indent = {
enable = true, enable = true,
}, },
textobjects = {
select = {
enable = true,
-- Jump to matching text objects
lookahead = true,
keymaps = {
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
["ab"] = "@block.outer",
["ib"] = "@block.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["af"] = "@function.outer",
["if"] = "@function.inner",
["ak"] = "@comment.outer",
},
},
},
}) })
EOF EOF