nix-config/modules/home/vim/plugin/settings/tree-sitter.lua
Bruno BELANYI 55362b1db8
All checks were successful
ci/woodpecker/push/check Pipeline was successful
home: vim: add remove deprecated option
The plug-in now configures itself automatically.

I could also set `vim.g.skip_ts_context_commentstring_module = true`,
but that should be removed soon enough anyway, and I would forget to
remove it...
2023-12-01 19:20:52 +00:00

54 lines
1.6 KiB
Lua

local ts_config = require("nvim-treesitter.configs")
ts_config.setup({
highlight = {
enable = true,
-- Avoid duplicate highlighting
additional_vim_regex_highlighting = false,
},
indent = {
enable = true,
},
textobjects = {
select = {
enable = true,
-- Jump to matching text objects
lookahead = true,
keymaps = {
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
["ab"] = "@block.outer",
["ib"] = "@block.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["af"] = "@function.outer",
["if"] = "@function.inner",
["ak"] = "@comment.outer",
["aS"] = "@statement.outer",
},
},
move = {
enable = true,
-- Add to jump list
set_jumps = true,
goto_next_start = {
["]m"] = "@function.outer",
["]S"] = "@statement.outer",
["]]"] = "@class.outer",
},
goto_next_end = {
["]M"] = "@function.outer",
["]["] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[S"] = "@statement.outer",
["[["] = "@class.outer",
},
goto_previous_end = {
["[M"] = "@function.outer",
["[]"] = "@class.outer",
},
},
},
})