mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-15 06:04:42 +00:00
update treesitter config for v1.x API (configs module removed)
This commit is contained in:
parent
e30404a7e1
commit
f3d61787f0
1 changed files with 42 additions and 47 deletions
|
|
@ -4,56 +4,51 @@ return {
|
||||||
build = ':TSUpdate',
|
build = ':TSUpdate',
|
||||||
dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects' },
|
dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects' },
|
||||||
config = function()
|
config = function()
|
||||||
require('nvim-treesitter.configs').setup({
|
require('nvim-treesitter-textobjects').setup({
|
||||||
auto_install = true,
|
select = {
|
||||||
highlight = { enable = true },
|
enable = true,
|
||||||
indent = { enable = true },
|
lookahead = true,
|
||||||
textobjects = {
|
keymaps = {
|
||||||
select = {
|
['af'] = '@function.outer',
|
||||||
enable = true,
|
['if'] = '@function.inner',
|
||||||
lookahead = true,
|
['ac'] = '@class.outer',
|
||||||
keymaps = {
|
['ic'] = '@class.inner',
|
||||||
['af'] = '@function.outer',
|
['aa'] = '@parameter.outer',
|
||||||
['if'] = '@function.inner',
|
['ia'] = '@parameter.inner',
|
||||||
['ac'] = '@class.outer',
|
['ai'] = '@conditional.outer',
|
||||||
['ic'] = '@class.inner',
|
['ii'] = '@conditional.inner',
|
||||||
['aa'] = '@parameter.outer',
|
['al'] = '@loop.outer',
|
||||||
['ia'] = '@parameter.inner',
|
['il'] = '@loop.inner',
|
||||||
['ai'] = '@conditional.outer',
|
['ab'] = '@block.outer',
|
||||||
['ii'] = '@conditional.inner',
|
['ib'] = '@block.inner',
|
||||||
['al'] = '@loop.outer',
|
|
||||||
['il'] = '@loop.inner',
|
|
||||||
['ab'] = '@block.outer',
|
|
||||||
['ib'] = '@block.inner',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
move = {
|
},
|
||||||
enable = true,
|
move = {
|
||||||
set_jumps = true,
|
enable = true,
|
||||||
goto_next_start = {
|
set_jumps = true,
|
||||||
[']f'] = '@function.outer',
|
goto_next_start = {
|
||||||
[']c'] = '@class.outer',
|
[']f'] = '@function.outer',
|
||||||
[']a'] = '@parameter.inner',
|
[']c'] = '@class.outer',
|
||||||
},
|
[']a'] = '@parameter.inner',
|
||||||
goto_next_end = {
|
|
||||||
[']F'] = '@function.outer',
|
|
||||||
[']C'] = '@class.outer',
|
|
||||||
},
|
|
||||||
goto_previous_start = {
|
|
||||||
['[f'] = '@function.outer',
|
|
||||||
['[c'] = '@class.outer',
|
|
||||||
['[a'] = '@parameter.inner',
|
|
||||||
},
|
|
||||||
goto_previous_end = {
|
|
||||||
['[F'] = '@function.outer',
|
|
||||||
['[C'] = '@class.outer',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
swap = {
|
goto_next_end = {
|
||||||
enable = true,
|
[']F'] = '@function.outer',
|
||||||
swap_next = { ['<leader>sn'] = '@parameter.inner' },
|
[']C'] = '@class.outer',
|
||||||
swap_previous = { ['<leader>sp'] = '@parameter.inner' },
|
|
||||||
},
|
},
|
||||||
|
goto_previous_start = {
|
||||||
|
['[f'] = '@function.outer',
|
||||||
|
['[c'] = '@class.outer',
|
||||||
|
['[a'] = '@parameter.inner',
|
||||||
|
},
|
||||||
|
goto_previous_end = {
|
||||||
|
['[F'] = '@function.outer',
|
||||||
|
['[C'] = '@class.outer',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
swap = {
|
||||||
|
enable = true,
|
||||||
|
swap_next = { ['<leader>sn'] = '@parameter.inner' },
|
||||||
|
swap_previous = { ['<leader>sp'] = '@parameter.inner' },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue