fix(neovim): migrate LSP config to native vim.lsp.config API

Replace deprecated require("lspconfig") setup with the Neovim 0.11+
native vim.lsp.config/vim.lsp.enable API. Clangd config now lives in
lsp/clangd.lua instead of the old plugins/lspconfig.lua +
configs/lspconfig.lua pair.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
marvin.dietermann
2026-04-10 15:02:01 +02:00
parent d1286329f8
commit 7021c915e6
2 changed files with 27 additions and 42 deletions

View File

@@ -298,29 +298,27 @@ return {
}
```
Create `~/.config/nvim/lua/plugins/lsp.lua`:
Create `~/.config/nvim/lsp/clangd.lua` (native Neovim 0.11+ LSP config):
```lua
return {
{
"neovim/nvim-lspconfig",
opts = {
servers = {
clangd = {
cmd = {
"clangd",
"--background-index",
"--clang-tidy",
"--header-insertion=iwyu",
"--completion-style=detailed",
},
},
},
},
cmd = {
"clangd",
"--background-index",
"--clang-tidy",
"--header-insertion=iwyu",
"--completion-style=detailed",
},
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "arduino" },
}
```
Enable the server (e.g. in `init.lua` or a plugin file):
```lua
vim.lsp.enable("clangd")
```
---
## 5. Arduino CLI