-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Project local settings
Justin M. Keyes edited this page Feb 28, 2025
·
18 revisions
There are server configs for many LSP servers. For instance for the lua-language-server there is a project/workspace-relative config file called .luarc.json
that is loaded from a root path of a workspace.
See :help 'exrc'
. Local settings can be configured by enabling :set exrc
in your init.vim
and creating a .nvim.lua
file in the project directory. If Nvim is launched
in the same directory as .nvim.lua
, it will evaluate your user configuration first,
followed by the local configuration. An example .nvim.lua
is:
local nvim_lsp = require('lspconfig')
nvim_lsp.rust_analyzer.setup {
root_dir = function()
return vim.fn.getcwd()
end
}
After enabling 'exrc', Nvim will execute any .nvim.lua
, .nvimrc
or .exrc
that you have added to the trust list and has not changed since you added it (Nvim will prompt you if it has changed).
footer