feat(neovim): set up nvim-treesitter
This commit is contained in:
parent
64a9bc40cb
commit
9c769cdec0
3 changed files with 61 additions and 4 deletions
47
home/editors/neovim/treesitter.lua
Normal file
47
home/editors/neovim/treesitter.lua
Normal file
|
@ -0,0 +1,47 @@
|
|||
-- TODO install parsers declaratively instead of :TSInstall & :TSUpdate
|
||||
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
ensure_installed = 'all',
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
refactor = {
|
||||
highlight_definitions = { enable = true },
|
||||
highlight_current_scope = { enable = true },
|
||||
navigation = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
goto_definition_lsp_fallback = "gnd",
|
||||
list_definitions = "gnD",
|
||||
list_definitions_toc = "gO",
|
||||
goto_next_usage = "<a-*>",
|
||||
goto_previous_usage = "<a-#>",
|
||||
},
|
||||
},
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<CR>",
|
||||
scope_incremental = "<CR>",
|
||||
node_incremental = "<TAB>",
|
||||
node_decremental = "<S-TAB>",
|
||||
},
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
["aa"] = "@parameter.outer",
|
||||
["ia"] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue