neovim: Fix tree-sitter configuration

This changes the used parsers from an allowlist to a denylist.
This commit is contained in:
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-jdtls
nvim-lspconfig nvim-lspconfig
nvim-solarized-lua nvim-solarized-lua
nvim-treesitter nvim-treesitter.withAllGrammars
nvim-web-devicons nvim-web-devicons
plantuml-syntax plantuml-syntax
plenary-nvim plenary-nvim
@ -111,29 +111,7 @@ in
xdg.configFile = { xdg.configFile = {
"nvim/lua/init.lua".source = ./init.lua; "nvim/lua/init.lua".source = ./init.lua;
"nvim/lua/snippets.lua".source = pkgs.callPackage ./snippets.nix { }; "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"; home.sessionVariables.EDITOR = "nvim";
} }

View file

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