nixvim/config/plugins/editor/treesitter.nix
Roel de Cort 92c42db332
patch: treesitter highlighting, lsp inlay hints and update flake (#20)
Small update to enable Treesitter highlighting by default, enable LSP
inlay hints and update flake inputs to the latest version
2024-08-03 22:08:02 +02:00

61 lines
1.4 KiB
Nix

{pkgs, ...}: {
plugins.treesitter = {
enable = true;
settings = {
indent.enable = true;
highlight.enable = true;
};
folding = false;
nixvimInjections = true;
grammarPackages = pkgs.vimPlugins.nvim-treesitter.allGrammars;
};
plugins.treesitter-textobjects = {
enable = false;
select = {
enable = true;
lookahead = true;
keymaps = {
"aa" = "@parameter.outer";
"ia" = "@parameter.inner";
"af" = "@function.outer";
"if" = "@function.inner";
"ac" = "@class.outer";
"ic" = "@class.inner";
"ii" = "@conditional.inner";
"ai" = "@conditional.outer";
"il" = "@loop.inner";
"al" = "@loop.outer";
"at" = "@comment.outer";
};
};
move = {
enable = true;
gotoNextStart = {
"]m" = "@function.outer";
"]]" = "@class.outer";
};
gotoNextEnd = {
"]M" = "@function.outer";
"][" = "@class.outer";
};
gotoPreviousStart = {
"[m" = "@function.outer";
"[[" = "@class.outer";
};
gotoPreviousEnd = {
"[M" = "@function.outer";
"[]" = "@class.outer";
};
};
swap = {
enable = true;
swapNext = {
"<leader>a" = "@parameters.inner";
};
swapPrevious = {
"<leader>A" = "@parameter.outer";
};
};
};
}