docs(readme): fix example of the parser install directory (#6737)

This commit is contained in:
Λlisue (Ali sue・ありすえ) 2024-06-06 22:56:50 +09:00 committed by GitHub
parent fc9ee79f64
commit 3a74b58310
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -548,11 +548,13 @@ 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
This directory must be writeable and must be explicitly prepended to the
`runtimepath`. For example:
```lua
vim.opt.runtimepath:append("/some/path/to/store/parsers")
-- It MUST be at the beginning of runtimepath. Otherwise the parsers from Neovim itself
-- is loaded that may not be compatible with the queries from the 'nvim-treesitter' plugin.
vim.opt.runtimepath:prepend("/some/path/to/store/parsers")
require'nvim-treesitter.configs'.setup {
parser_install_dir = "/some/path/to/store/parsers",