diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2025-12-08 00:35:53 -0700 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2025-12-08 00:35:53 -0700 |
| commit | 2ccfffec265fdf33c04c252e1f9006b36591ce94 (patch) | |
| tree | 6d4438cca2ad296e13d21d77950c0eb87eb5d816 /vim/plugin/ts.vim | |
| parent | 4ec9d71f89e2cdc80ec57b7da99b17f0f9d6ec8f (diff) | |
| download | fiddle-2ccfffec265fdf33c04c252e1f9006b36591ce94.tar.gz fiddle-2ccfffec265fdf33c04c252e1f9006b36591ce94.tar.bz2 fiddle-2ccfffec265fdf33c04c252e1f9006b36591ce94.zip | |
Generic treesitter finding.
Diffstat (limited to 'vim/plugin/ts.vim')
| -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, |