home: vim: add 'treesitter-textobjects'

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

View file

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

View file

@ -9,5 +9,23 @@ ts_config.setup({
indent = {
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