mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/treesitter: update docs for custom grammar installation
This commit is contained in:
parent
354fc0f288
commit
9f32e25f3f
1 changed files with 27 additions and 25 deletions
|
@ -102,31 +102,33 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
# treesitter-nu-grammar = pkgs.tree-sitter-grammars.tree-sitter-nu;
|
||||
in
|
||||
{
|
||||
programs.nixvim.plugins = {
|
||||
treesitter = {
|
||||
enable = true;
|
||||
settings.indent.enable = true;
|
||||
grammarPackages = pkgs.vimPlugins.nvim-treesitter.passthru.allGrammars ++ [
|
||||
treesitter-nu-grammar
|
||||
];
|
||||
luaConfig.post=
|
||||
'''
|
||||
do
|
||||
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||
-- change the following as needed
|
||||
parser_config.nu = {
|
||||
install_info = {
|
||||
url = "''${treesitter-nu-grammar}", -- local path or git repo
|
||||
files = {"src/parser.c"}, -- note that some parsers also require src/scanner.c or src/scanner.cc
|
||||
-- optional entries:
|
||||
-- branch = "main", -- default branch in case of git repo if different from master
|
||||
-- generate_requires_npm = false, -- if stand-alone parser without npm dependencies
|
||||
-- requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
|
||||
},
|
||||
filetype = "nu", -- if filetype does not match the parser name
|
||||
}
|
||||
end
|
||||
''';
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
treesitter = {
|
||||
enable = true;
|
||||
settings.indent.enable = true;
|
||||
grammarPackages = pkgs.vimPlugins.nvim-treesitter.passthru.allGrammars ++ [
|
||||
treesitter-nu-grammar
|
||||
];
|
||||
luaConfig.post=
|
||||
'''
|
||||
do
|
||||
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||
-- change the following as needed
|
||||
parser_config.nu = {
|
||||
install_info = {
|
||||
url = "''${treesitter-nu-grammar}", -- local path or git repo
|
||||
files = {"src/parser.c"}, -- note that some parsers also require src/scanner.c or src/scanner.cc
|
||||
-- optional entries:
|
||||
-- branch = "main", -- default branch in case of git repo if different from master
|
||||
-- generate_requires_npm = false, -- if stand-alone parser without npm dependencies
|
||||
-- requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
|
||||
},
|
||||
filetype = "nu", -- if filetype does not match the parser name
|
||||
}
|
||||
end
|
||||
''';
|
||||
};
|
||||
};
|
||||
|
||||
# Add as extra plugins so that their `queries/{language}/*.scm` get
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue