neovim /nvim-lspconfig

Quickstart configs for Nvim LSP

★ 14,014⑂ 2,502👁 78⑃ 2,972● 1,488▤ 24
LuaApache-2.0Created 2019-11-13
TA的项目
下载:v2.12.0v2.12.0 ↓2.12.02026-09-23
+2
日增长
+16
周增长
+42
月增长
14,014
stars
2,502
forks
78
watchers
2,972
prs
1,488
issues
24
releases

README

nvim-lspconfig

nvim-lspconfig is a collection of LSP server configurations for the Nvim LSP client.

View all configs, or run :help lspconfig-all from Nvim.

 Important ⚠️

 require('lspconfig') (the legacy "framework" of nvim-lspconfig) is deprecated in favor of vim.lsp.config (Nvim 0.11+).
     The lspconfig.lua module will be dropped. Calls to require('lspconfig') will show a warning, which will later become an error.
 nvim-lspconfig itself is NOT deprecated. It provides server-specific configs.
     The configs live in the lsp/ directory. vim.lsp.config automatically finds them and merges them with any local lsp/.lua configs defined by you or a plugin.
     The old configs in lua/lspconfig/ are deprecated and will be removed.

 Migration instructions

1. Upgrade to Nvim 0.11+
2. (Optional) Use vim.lsp.config('…') (not require'lspconfig'.….setup{}) to customize or define a config.
3. Use vim.lsp.enable('…') (not require'lspconfig'.….setup{}) to enable a config, so that it activates for its filetypes.

 Support

These configs are best-effort and supported by the community (you). See contributions.

 Ask questions on GitHub Discussions, not the issue tracker.
 If you found a bug in Nvim LSP (:help lsp), report it to Neovim core.
     Do not report it here. Only configuration data lives here.

 Install



 Requires Nvim 0.11.3+.
     Support for Nvim 0.10 will be removed. Upgrade Nvim and nvim-lspconfig before reporting an issue.
 With Nvim 0.12+, you can use the builtin vim.pack plugin manager:
  lua
  vim.pack.add{
    { src = 'https://github.com/neovim/nvim-lspconfig' },
  }
  
 Or install nvim-lspconfig using Vim's "packages" feature:
  
  git clone https://github.com/neovim/nvim-lspconfig ~/.config/nvim/pack/nvim/start/nvim-lspconfig
  
 Or use a 3rd-party plugin manager.

 Quickstart

1. Install a language server, e.g. pyright
   bash
   npm i -g pyright
   
2. Enable its config in your init.lua (:help lsp-quickstart).
   lua
   vim.lsp.enable('pyright')
   
3. Ensure your project/workspace contains a root marker as specified in :help lspconfig-all.
4. Open a code file in Nvim. LSP will attach and provide diagnostics.
   
   nvim main.py
   
5. Run :checkhealth vim.lsp to see the status or to troubleshoot.

See :help lspconfig-all for the full list of server-specific details. For
servers not on your $PATH (e.g., jdtls, elixirls), you must manually set
the cmd parameter:

lua
vim.lsp.config('jdtls', {
  cmd = { '/path/to/jdtls' },
})


 Commands

 :LspInfo (alias to :checkhealth vim.lsp) shows the status of active and configured language servers.
 :lsp enable [] (:LspStart for Nvim 0.11 or older) Start the requested server name. Will only successfully start if the command detects a root directory matching the current config.
 :lsp disable [] (:LspStop for Nvim 0.11 or older) Stops the given server. Defaults to stopping all servers active on the current buffer. To force stop use :LspStop!
 :lsp restart [] (:LspRestart for Nvim 0.11 or older)

Top issues

Latest release

v2.12.0 v2.12.0 2026-09-23
What's Changed
 feat: agentscript by @Booyaka101 in https://github.com/neovim/nvim-lspconfig/pull/4483
 docs(astro): update language-tools URLs by @tdhuan in https://github.com/neovim/nvim-lspconfig/pull/4485
 docs(astro): document TypeScript 7.x limitation and npm-global fallback example by @tdhuan in https://github.com/neovim/nvim-lspconfig/pull/4486
 corrected roslyn_ls.lua call to .iter to take a table as expected by @chepeniv in https://github.com/neovim/nvim-lspconfig/pull/4487
 feat(oxfmt): enable for svelte by @igorlfs in https://github.com/neovim/nvim-lspconfig/pull/4488
 docs(e

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON