From 6be1975d066171b815e97f327f577b844098d26f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 4 May 2024 19:31:50 +0200 Subject: [PATCH] [feature] nvim: specify tresitter grammars Currently we use a lot of tree sitter grammars --- nvim/nixvim.nix | 2 +- nvim/plugins.nix | 63 ++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 62 insertions(+), 3 deletions(-) diff --git a/nvim/nixvim.nix b/nvim/nixvim.nix index d5dd641..1158cdc 100644 --- a/nvim/nixvim.nix +++ b/nvim/nixvim.nix @@ -49,7 +49,7 @@ in # Enable local configuration :h 'exrc' exrc = true; # safe since nvim 0.9 }; - plugins = import ./plugins.nix { inherit lib; }; + plugins = import ./plugins.nix { inherit lib pkgs; }; keymaps = import ./mappings.nix; inherit (import ./augroups.nix) autoGroups autoCmd; extraPlugins = diff --git a/nvim/plugins.nix b/nvim/plugins.nix index 616a5a6..4243adf 100644 --- a/nvim/plugins.nix +++ b/nvim/plugins.nix @@ -1,4 +1,4 @@ -{ lib }: +{ lib, pkgs }: { bacon = { enable = true; @@ -196,8 +196,67 @@ enable = true; indent = true; incrementalSelection.enable = true; + grammarPackages = + let + parsers = pkgs.vimPlugins.nvim-treesitter-parsers; + in + [ + parsers.asm + parsers.bash + # parsers.bibtex + parsers.c + parsers.comment + parsers.commonlisp + parsers.cpp + parsers.css + parsers.csv + # parsers.d + parsers.diff + parsers.dockerfile + parsers.dot + parsers.doxygen + parsers.git_config + parsers.git_rebase + parsers.gitattributes + parsers.gitcommit + parsers.gitignore + parsers.go + parsers.gomod + parsers.gosum + parsers.gowork + parsers.html + parsers.ini + parsers.json + parsers.json5 + parsers.jsonc + # parsers.latex + parsers.lua + parsers.luadoc + parsers.luap + parsers.luau + parsers.make + parsers.markdown + parsers.markdown_inline + parsers.meson + parsers.nix + parsers.ocaml + parsers.ocaml_interface + parsers.pem + parsers.python + parsers.rust + parsers.scheme + parsers.sql + parsers.ssh_config + parsers.toml + parsers.tsv + parsers.vim + parsers.vimdoc + parsers.wgsl + parsers.wgsl_bevy + parsers.yaml + parsers.zig + ]; }; - treesitter-context.enable = true; trouble = { enable = true; settings.auto_close = true;