mirror of
https://github.com/tomru/nvim.git
synced 2026-03-04 06:57:15 +01:00
update treesitter config
This commit is contained in:
@@ -2,6 +2,10 @@ return {
|
||||
{ -- Highlight, edit, and navigate code
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
'chrisgrieser/nvim-various-textobjs',
|
||||
},
|
||||
opts = {
|
||||
ensure_installed = { 'bash', 'html', 'lua', 'markdown', 'vim', 'vimdoc', 'javascript', 'typescript', 'rust' },
|
||||
ignore_install = { 'org' },
|
||||
@@ -16,6 +20,46 @@ return {
|
||||
},
|
||||
indent = { enable = true },
|
||||
-- indent = { enable = true, disable = { 'ruby' } },
|
||||
textobjects = {
|
||||
lsp_interop = {
|
||||
enable = true,
|
||||
border = 'rounded',
|
||||
peek_definition_code = {
|
||||
['df'] = '@function.outer',
|
||||
['dF'] = '@class.outer',
|
||||
},
|
||||
},
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
['af'] = '@function.outer',
|
||||
['if'] = '@function.inner',
|
||||
['ac'] = '@class.outer',
|
||||
['ic'] = '@class.inner',
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true,
|
||||
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',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
||||
@@ -31,6 +75,4 @@ return {
|
||||
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||
end,
|
||||
},
|
||||
{ 'nvim-treesitter/nvim-treesitter-textobjects' },
|
||||
{ 'chrisgrieser/nvim-various-textobjs' },
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user