diff options
Diffstat (limited to 'vim/plugin')
| -rw-r--r-- | vim/plugin/ts.vim | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vim/plugin/ts.vim b/vim/plugin/ts.vim index c64a265..1c36088 100644 --- a/vim/plugin/ts.vim +++ b/vim/plugin/ts.vim @@ -2,9 +2,14 @@ lua <<EOF local parser_config = require("nvim-treesitter.parsers").get_parser_configs() + -- Resolve the grammar directory relative to this plugin file so it works + -- regardless of the current working directory or checkout location. + local plugin_dir = vim.fs.dirname(debug.getinfo(1, "S").source:sub(2)) + local grammar_dir = vim.fs.normalize(vim.fs.joinpath(plugin_dir, "..", "treesitter")) + parser_config.fiddle = { install_info = { - url = "/home/rahm/Projects/fiddle/tree-sitter-fiddle", -- adjust to where the folder lives + url = grammar_dir, files = { "src/parser.c" }, generate_requires_npm = true, requires_generate_from_grammar = true, |