neovim: Fix tree-sitter configuration

This changes the used parsers from an allowlist to a denylist.
renge2
Simon Bruder 2023-12-18 14:19:34 +01:00
parent 95590d6bc3
commit bf01605517
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
2 changed files with 13 additions and 31 deletions

View File

@ -87,7 +87,7 @@ in
nvim-jdtls
nvim-lspconfig
nvim-solarized-lua
nvim-treesitter
nvim-treesitter.withAllGrammars
nvim-web-devicons
plantuml-syntax
plenary-nvim
@ -111,29 +111,7 @@ in
xdg.configFile = {
"nvim/lua/init.lua".source = ./init.lua;
"nvim/lua/snippets.lua".source = pkgs.callPackage ./snippets.nix { };
} // (lib.mapAttrs'
(name: path: lib.nameValuePair "nvim/parser/${lib.removePrefix "tree-sitter-" name}.so" { source = "${path}/parser"; })
({
inherit (pkgs.tree-sitter.builtGrammars)
#tree-sitter-bash
tree-sitter-c
tree-sitter-cpp
tree-sitter-css
tree-sitter-dot
tree-sitter-go
tree-sitter-haskell
tree-sitter-html
tree-sitter-json
#tree-sitter-latex # incompatible with VimTeX
tree-sitter-lua
tree-sitter-nix
tree-sitter-perl
tree-sitter-python
tree-sitter-rust
tree-sitter-scss
tree-sitter-toml
tree-sitter-yaml;
}));
};
home.sessionVariables.EDITOR = "nvim";
}

View File

@ -421,13 +421,17 @@ require('trouble').setup {}
-- Tree Sitter
require('nvim-treesitter.configs').setup {
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = {
enable = true,
},
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
disable = {
'gitcommit', -- only for “conventional commits”
'latex', -- incompatible with VimTeX
},
},
indent = {
enable = true,
},
}
-- VimTeX