diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2025-05-29 18:23:42 +0200 |
|---|---|---|
| committer | Christian Clason <ch.clason+github@icloud.com> | 2025-06-04 11:35:41 +0200 |
| commit | 057e845518222c968251da7c7e7d4074c9620a1b (patch) | |
| tree | 4ee6f24c449bc3ce14a316556af91c64442c2ff3 /README.md | |
| parent | feat(parsers): update bash, scala, slang, hyprlang, ini, query, javadoc, xml,... (diff) | |
| download | nvim-treesitter-057e845518222c968251da7c7e7d4074c9620a1b.tar nvim-treesitter-057e845518222c968251da7c7e7d4074c9620a1b.tar.gz nvim-treesitter-057e845518222c968251da7c7e7d4074c9620a1b.tar.bz2 nvim-treesitter-057e845518222c968251da7c7e7d4074c9620a1b.tar.lz nvim-treesitter-057e845518222c968251da7c7e7d4074c9620a1b.tar.xz nvim-treesitter-057e845518222c968251da7c7e7d4074c9620a1b.tar.zst nvim-treesitter-057e845518222c968251da7c7e7d4074c9620a1b.zip | |
feat(install): support custom queries
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -126,7 +126,7 @@ These queries can be used to look up definitions and references to identifiers i # Advanced setup -## Adding parsers +## Adding custom languages If you have a parser that is not on the list of supported languages (either as a repository on Github or in a local directory), you can add it manually for use by `nvim-treesitter` as follows: @@ -144,6 +144,7 @@ callback = function() location = 'parser', -- only needed if the parser is in subdirectory of a "monorepo" generate = true, -- only needed if repo does not contain pre-generated `src/parser.c` generate_from_json = false, -- only needed if repo does not contain `src/grammar.json` either + queries = 'queries/neovim', -- also install queries from given directory }, } end}) @@ -158,6 +159,7 @@ Alternatively, if you have a local checkout, you can instead use location = 'parser', generate = true, generate_from_json = false, + queries = 'queries/neovim', -- symlink queries from given directory }, ``` This will always use the state of the directory as-is (i.e., `branch` and `revision` will be ignored). @@ -189,9 +191,3 @@ end}) ## Adding queries Queries can be placed anywhere in your `runtimepath` under `queries/<language>`, with earlier directories taking precedence unless the queries are marked with `; extends`; see [`:h treesitter-query-modelines`](https://neovim.io/doc/user/treesitter.html#treesitter-query-modeline). - -E.g., to add queries for `zimbu`, put `highlights.scm` etc. under - -```lua -vim.fn.stdpath('data') .. 'site/queries/zimbu' -``` |
