add treesitter

This commit is contained in:
Aditya 2024-03-04 19:53:00 +05:30
parent 76c7468f5a
commit ac2cfabf1e
Signed by: aditya
SSH key fingerprint: SHA256:jL1IvWsjjlPtw6HvDIHfXfhO9IkIokNEyIfuFhSdoyU
4 changed files with 68 additions and 0 deletions

View file

@ -14,6 +14,10 @@
./git/lazygit.nix
./git/neogit.nix
./languages/treesitter/treesitter-context.nix
./languages/treesitter/treesitter-textobjects.nix
./languages/treesitter/treesitter.nix
./dap/dap.nix
./filetrees/neo-tree.nix

View file

@ -0,0 +1,5 @@
{
plugins.treesitter-context = {
enable = true;
};
}

View file

@ -0,0 +1,51 @@
{
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";
};
};
};
}

View file

@ -0,0 +1,8 @@
{
plugins.treesitter = {
enable = true;
indent = true;
folding = true;
nixvimInjections = true;
};
}