From 3a74b5831058d0daf8952a5b8c556c61b30a3f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=9Blisue=20=28Ali=20sue=E3=83=BB=E3=81=82=E3=82=8A?= =?UTF-8?q?=E3=81=99=E3=81=88=29?= Date: Thu, 6 Jun 2024 22:56:50 +0900 Subject: [PATCH] docs(readme): fix example of the parser install directory (#6737) --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 28b24faff..f3a860d31 100644 --- a/README.md +++ b/README.md @@ -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",