diff options
| author | Duncan McDougall <dncn.mcdougall@gmail.com> | 2022-06-20 21:50:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-20 22:50:07 +0200 |
| commit | 901ffe1a363f21c168eacf011dce4f905fd26d5f (patch) | |
| tree | 49f905970eff9ce1ebefa797798909ea1229cde9 /README.md | |
| parent | 37b9a2971f749ab6d5ac9c8792f6e133fed027aa (diff) | |
Add support for custom parser install locations #2959 (#3031)
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -357,6 +357,38 @@ This will respect your `foldminlines` and `foldnestmax` settings. # Advanced setup +## Changing the parser install directory + +If you want to install the parsers to a custom directory you can specify this +directory with `parser_install_dir` option in that is passed to `setup`. +`nvim-treesitter` will then install the parser files into this directory. + +This directory must be writeable and must be explicitly added to the +`runtimepath`. For example: + +``` lua + require'nvim-treesitter.configs'.setup { + parser_install_dir = "/some/path/to/store/parsers", + + ... + + } + vim.opt.runtimepath:append("/some/path/to/store/parsers") +``` + +If this option is not included in the setup options, or is explicitly set to +`nil` then the default install directories will be used. If this value is set +the default directories will be ignored. + +Bear in mind that any parser installed into a parser folder on the runtime path +will still be considered installed. (For example if +"~/.local/share/nvim/site/parser/c.so" exists then the "c" parser will be +considered installed, even though it is not in `parser_install_dir`) + +The default paths are: +1. first the package folder. Where `nvim-treesitter` is installed. +2. second the site directory. This is the "site" subdirectory of `stdpath("data")`. + ## Adding parsers 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: |
