gitmyhub

nvim-lspconfig

Lua ★ 14k updated 1d ago

Quickstart configs for Nvim LSP

nvim-lspconfig is a Neovim plugin with pre-built configurations for hundreds of language servers, giving your editor autocomplete, error highlighting, and go-to-definition without manual setup for each language.

LuaNeovimLSPsetup: moderatecomplexity 3/5

nvim-lspconfig is a plugin for Neovim, a programmable text editor popular with developers. It provides ready-made configuration files that tell Neovim how to talk to "language servers", which are separate background programs that understand a specific programming language. A language server is what gives your editor features like error highlighting, auto-complete suggestions, and jump-to-definition, without the editor itself needing to understand every language.

Without nvim-lspconfig, you would need to write the setup details for each language server yourself: which command to run, which file types it handles, how to find the root of your project. This plugin ships with that information pre-written for hundreds of servers, so you only need to install the server and tell Neovim to turn it on.

The current way to use the plugin is with Neovim version 0.11 or newer. You install a language server on your machine, add a single line like vim.lsp.enable("pyright") to your Neovim config file for Python, and Neovim will activate that server whenever you open a matching file. The plugin automatically finds the right configuration for that server and applies it.

One thing to be aware of: an older style of using this plugin, through require("lspconfig"), is now deprecated and will eventually stop working. If you have an older Neovim config that uses that pattern, the README includes short migration instructions for switching to the new approach.

The configurations themselves are maintained by the community rather than a dedicated paid team, so quality varies by server. If something does not work, the recommended first step is running the built-in health check command inside Neovim, which reports whether the server is installed, whether it started, and whether it attached to the file you opened.

Where it fits