Skip to content

Modernize Neovim LSP setup to the native 0.11 stack#25

Merged
RWejlgaard merged 1 commit into
masterfrom
chore/modernize-nvim-lsp
Jun 25, 2026
Merged

Modernize Neovim LSP setup to the native 0.11 stack#25
RWejlgaard merged 1 commit into
masterfrom
chore/modernize-nvim-lsp

Conversation

@RWejlgaard

Copy link
Copy Markdown
Owner

Migrates the Neovim LSP config off the deprecated machinery onto Neovim 0.11's built-in LSP.

Why

  • williamboman/nvim-lsp-installer was archived in early 2023 and fully superseded by mason — it was dead, redundant weight (require("nvim-lsp-installer").setup{} alongside a working mason setup).
  • The williamboman/* mason repos moved to the mason-org/* org.
  • mason-lspconfig v2 removed the handlers API and now auto-enables installed servers via vim.lsp.enable(), so the lsp_zero.default_setup coupling no longer applies.
  • lsp-zero has pivoted to "just use native LSP" on 0.11.

What changed

  • Plugins: mason-org/mason.nvim + mason-org/mason-lspconfig.nvim (with ensure_installed), dropped lsp-zero and nvim-lsp-installer, and split nvim-cmp into its own spec carrying the completion deps.
  • Completion capabilities applied to all servers via vim.lsp.config('*', { capabilities = ... }).
  • lua_ls runtime/vim-global settings via vim.lsp.config('lua_ls', ...).
  • LSP keymaps reimplemented on LspAttach, preserving the previous lsp-zero bindings (K, gd, gD, gi, go, gr, gs, <F2>, <F4>) so muscle memory is unchanged.

Validation

Ran in an isolated headless Neovim (separate XDG dirs, real config untouched):

  • Lazy! sync installs all plugins, exit 0.
  • init.lua loads with no Lua errors; vim.lsp.config for lua_ls + *, mason, mason-lspconfig, and cmp all register; lsp-zero and nvim-lsp-installer are gone.
  • Opened a real .lua buffer → lua_ls attaches and the gd keymap is set buffer-locally.

No keybinding or feature changes for day-to-day use; this is a dependency/API modernization.

Drop lsp-zero and the archived nvim-lsp-installer in favour of Neovim
0.11's built-in LSP. mason-lspconfig v2 now auto-enables the servers it
installs, so the old `handlers`/`default_setup` coupling is gone.

- mason repos moved to the mason-org org (williamboman is deprecated).
- Completion capabilities applied via vim.lsp.config('*', ...).
- lua_ls runtime settings via vim.lsp.config('lua_ls', ...).
- LSP keymaps reimplemented on LspAttach, preserving the previous
  lsp-zero bindings (K, gd, gD, gi, go, gr, gs, <F2>, <F4>).

Validated in an isolated headless Neovim: plugins sync, init loads with
no errors, and lua_ls attaches to a Lua buffer with the keymaps applied.
@RWejlgaard RWejlgaard merged commit d17fb82 into master Jun 25, 2026
7 of 10 checks passed
@RWejlgaard RWejlgaard deleted the chore/modernize-nvim-lsp branch June 25, 2026 20:02
RWejlgaard added a commit that referenced this pull request Jun 25, 2026
Two leftovers from the lsp-zero removal in #25:

- Unify nvim-web-devicons on the nvim-tree/ repo. barbar and trouble
  still pulled the old kyazdani42/ name, loading the same plugin twice
  under two identities.
- Settle on a single snippet engine. cmp expanded via vsnip while
  LuaSnip + friendly-snippets loaded and did nothing (friendly-snippets
  are LuaSnip-format, so they never reached completion). Drop vim-vsnip,
  expand via luasnip, lazy_load the friendly-snippets library, and add
  the luasnip cmp source so the snippets actually surface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant