aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorSergei Slipchenko <faergeek@gmail.com>2025-07-25 00:41:56 +0400
committerGitHub <noreply@github.com>2025-07-24 13:41:56 -0700
commit4d3b3bb8815fbe37bcaf3dbdb12a22382bc11ebe (patch)
tree8f141671911960e6496803d0e2c33c025db8df33 /README.md
parentfeat(biome): monorepo support #3972 (diff)
downloadnvim-lspconfig-4d3b3bb8815fbe37bcaf3dbdb12a22382bc11ebe.tar
nvim-lspconfig-4d3b3bb8815fbe37bcaf3dbdb12a22382bc11ebe.tar.gz
nvim-lspconfig-4d3b3bb8815fbe37bcaf3dbdb12a22382bc11ebe.tar.bz2
nvim-lspconfig-4d3b3bb8815fbe37bcaf3dbdb12a22382bc11ebe.tar.lz
nvim-lspconfig-4d3b3bb8815fbe37bcaf3dbdb12a22382bc11ebe.tar.xz
nvim-lspconfig-4d3b3bb8815fbe37bcaf3dbdb12a22382bc11ebe.tar.zst
nvim-lspconfig-4d3b3bb8815fbe37bcaf3dbdb12a22382bc11ebe.zip
docs: mention 'exrc' for project-local configuration #3973
Diffstat (limited to 'README.md')
-rw-r--r--README.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/README.md b/README.md
index dc045551..ea711a69 100644
--- a/README.md
+++ b/README.md
@@ -126,6 +126,14 @@ Start with `:checkhealth vim.lsp` to troubleshoot. The most common reasons a lan
2. Missing filetype plugins. Some languages are not detected by Nvim because they have not yet been added to the filetype detection system. Ensure `:set filetype?` shows the filetype and not an empty value.
3. Not triggering root detection. Some language servers require a "workspace", which is found by looking for an ancestor directory that contains a "root marker". The most common root marker is `.git/`, but each config defines other "root marker" names. Root markers/directories are listed in `:help lspconfig-all`.
+ You can also explicitly set a root instead of relying on automatic detection by enabling `'exrc'` and adding an `.nvim.lua` at the desired root dir with the following code:
+ ```lua
+ vim.lsp.config('<client name>', {
+ root_dir = vim.fn.fnamemodify(debug.getinfo(1, 'S').source:sub(2), ':p:h'),
+ })
+ ```
+ Note that prior to nvim 0.12 `exrc` file is executed only if it's inside of a cwd where you start `nvim`.
+
## Bug reports
If you found a bug with LSP functionality, [report it to Neovim core](https://github.com/neovim/neovim/issues/new?assignees=&labels=bug%2Clsp&template=lsp_bug_report.yml).