mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-09 16:54:36 +02:00
plugins/treesitter: switch to mkNeovimPlugin
This commit is contained in:
parent
c0ea106b4b
commit
435ef287ab
3 changed files with 386 additions and 193 deletions
|
@ -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
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue