update treesitter config (add incr. selection, indent)

This commit is contained in:
Anthony Rodriguez 2024-08-26 14:41:06 +02:00
parent a4623b8af9
commit 35f7b81ec7
Signed by: nezia
GPG key ID: EE3BE97C040A86CE

View file

@ -7,16 +7,17 @@
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
performance.byteCompileLua.enable = true;
clipboard.providers.wl-copy.enable = true;
globals.mapleader = " ";
colorschemes.catppuccin = { colorschemes.catppuccin = {
enable = true; enable = true;
settings = { flavour = "frappe"; }; settings = { flavour = "frappe"; };
}; };
performance.byteCompileLua.enable = true;
clipboard.providers.wl-copy.enable = true;
globals.mapleader = " ";
opts = { opts = {
smartindent = false; smartindent = false;
relativenumber = true; relativenumber = true;
@ -71,7 +72,7 @@
{ {
action = '' action = ''
<cmd>lua vim.lsp.buf.code_action({ apply = true })<CR> <cmd>lua vim.lsp.buf.code_action({ apply = true })<CR>
''; '';
key = "<leader>lc"; key = "<leader>lc";
options = { options = {
desc = "Apply code actions"; desc = "Apply code actions";
@ -80,7 +81,7 @@
{ {
action = '' action = ''
<cmd>lua vim.lsp.buf.format()<CR> <cmd>lua vim.lsp.buf.format()<CR>
''; '';
key = "<leader>lf"; key = "<leader>lf";
options = { options = {
desc = "Format buffer"; desc = "Format buffer";
@ -157,8 +158,27 @@
treesitter = { treesitter = {
enable = true; enable = true;
settings = { settings = {
highlight.enable = true; auto_install = true;
indent.enable = true; highlight = {
additional_vim_regex_highlighting = true;
custom_captures = { };
enable = true;
};
incremental_selection = {
enable = true;
keymaps = {
init_selection = false;
node_decremental = "grm";
node_incremental = "grn";
scope_incremental = "grc";
};
};
indent = {
enable = true;
};
parser_install_dir = {
__raw = "vim.fs.joinpath(vim.fn.stdpath('data'), 'treesitter')";
};
}; };
}; };
treesitter-context.enable = true; treesitter-context.enable = true;