feat: initial commit

- basic config according to spec
This commit is contained in:
johannes committed 2026-11-05 15:04:29 +01:00
commit 9b0446c5f6
36 files changed
+1114

No files matched your search

+54
View File
@@ -0,0 +1,54 @@
-- Servers start through native vim.lsp.enable. nvim-lspconfig only supplies
-- defaults; overrides live in lsp/<server>.lua. Called from plugins/lsp.lua.
local M = {}
M.servers = {
"nixd",
"lua_ls",
"bashls",
"yamlls",
"jsonls",
"marksman",
"rust_analyzer",
"gopls",
"vtsls",
"eslint",
"basedpyright",
"ruff",
"intelephense",
}
local function restart()
vim.cmd(vim.fn.exists(":lsp") == 2 and "lsp restart" or "LspRestart")
end
function M.setup()
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("core.lsp", { clear = true }),
callback = function(ev)
local client = vim.lsp.get_client_by_id(ev.data.client_id)
if not client then
return
end
if vim.b[ev.buf].bigfile then
vim.schedule(function()
vim.lsp.buf_detach_client(ev.buf, client.id)
end)
return
end
if client.name == "ruff" then
client.server_capabilities.hoverProvider = false -- basedpyright owns hover
end
local function map(lhs, rhs, desc)
vim.keymap.set("n", lhs, rhs, { buffer = ev.buf, desc = desc })
end
map("<leader>li", "<cmd>checkhealth vim.lsp<cr>", "LSP info")
map("<leader>lr", restart, "Restart LSP servers")
end,
})
vim.lsp.enable(M.servers)
end
return M