dotfiles/nvim/after/plugin/treesitter.lua
Nikos Papadakis ae3c9867f7
nix
2023-09-24 19:58:36 +03:00

52 lines
1.2 KiB
Lua

local ok, treesitter = pcall(require, "nvim-treesitter.configs")
if not ok then
return
end
treesitter.setup {
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = {
enable = false,
},
textobjects = {
select = {
enable = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ia"] = "@parameter.inner",
},
},
swap = {
enable = true,
swap_next = {
["<leader>@"] = "@parameter.inner",
},
},
move = {
enable = true,
goto_next_start = {
["]]"] = "@function.outer",
},
goto_next_end = {
["]["] = "@function.outer",
},
goto_previous_start = {
["[["] = "@function.outer",
},
goto_previous_end = {
["[]"] = "@function.outer",
},
},
},
playground = {
enable = true,
keybindings = {
update = "R",
toggle_query_editor = "o",
},
},
}