plugins/treesitter: switch to mkNeovimPlugin

This commit is contained in:
Austin Horstman 2024-07-01 23:00:34 -05:00
parent c0ea106b4b
commit 435ef287ab
No known key found for this signature in database
3 changed files with 386 additions and 193 deletions

View file

@ -1,18 +1,70 @@
{ pkgs, ... }:
{
default = {
plugins.treesitter = {
enable = true;
settings = {
auto_install = false;
ensure_installed = [ ];
ignore_install = [ ];
parser_install_dir = null;
sync_install = false;
highlight = {
additional_vim_regex_highlighting = false;
enable = false;
custom_captures = { };
disable = null;
};
incremental_selection = {
enable = false;
keymaps = {
init_selection = "gnn";
node_incremental = "grn";
scope_incremental = "grc";
node_decremental = "grm";
};
};
indent = {
enable = false;
};
};
};
};
empty = {
plugins.treesitter.enable = true;
};
nonix = {
# TODO: See if we can build parsers (legacy way)
tests.dontRun = true;
empty-grammar-packages = {
plugins.treesitter = {
enable = true;
nixGrammars = false;
grammarPackages = [ ];
};
};
nixvimInjections = {
highlight-disable-function = {
plugins.treesitter = {
enable = true;
settings = {
highlight = {
enable = true;
disable = ''
function(lang, bufnr)
return api.nvim_buf_line_count(bufnr) > 50000
end
'';
};
};
};
};
nixvim-injections = {
plugins.treesitter = {
enable = true;
nixvimInjections = true;
@ -27,18 +79,43 @@
};
};
# This needs a custom input
# custom = {
# plugins.treesitter = {
# enable = true;
# nixGrammars = true;
# grammarPackages = [
# (build-ts.lib.buildGrammar pkgs {
# language = "gleam";
# version = "0.25.0";
# source = gleam;
# })
# ];
# };
# };
no-nix = {
# TODO: See if we can build parsers (legacy way)
tests.dontRun = true;
plugins.treesitter = {
enable = true;
nixGrammars = false;
};
};
specific-grammars = {
plugins.treesitter = {
enable = true;
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
bash
git_config
git_rebase
gitattributes
gitcommit
gitignore
json
jsonc
lua
make
markdown
meson
ninja
nix
readline
regex
ssh-config
toml
vim
vimdoc
xml
yaml
];
};
};
}