mirror of
https://github.com/halfdan/dotfiles.git
synced 2025-04-26 12:25:39 +00:00
49 lines
1.2 KiB
Lua
49 lines
1.2 KiB
Lua
if vim.g.vscode then
|
|
return
|
|
end
|
|
|
|
require'nvim-treesitter.configs'.setup {
|
|
textobjects = {
|
|
select = {
|
|
enable = true,
|
|
|
|
-- Automatically jump forward to textobj, similar to targets.vim
|
|
lookahead = true,
|
|
|
|
keymaps = {
|
|
-- You can use the capture groups defined in textobjects.scm
|
|
["af"] = "@function.outer",
|
|
["if"] = "@function.inner",
|
|
["ac"] = "@class.outer",
|
|
["ic"] = "@class.inner",
|
|
},
|
|
-- You can choose the select mode (default is charwise 'v')
|
|
selection_modes = {
|
|
['@parameter.outer'] = 'v', -- charwise
|
|
['@function.outer'] = 'V', -- linewise
|
|
['@class.outer'] = '<c-v>', -- blockwise
|
|
},
|
|
},
|
|
move = {
|
|
enable = true,
|
|
set_jumps = true, -- whether to set jumps in the jumplist
|
|
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",
|
|
},
|
|
},
|
|
},
|
|
}
|