vim: remove deprecated lspconfig stuff

This commit is contained in:
2025-11-13 21:45:21 +01:00
parent 8d2d646831
commit 0990d27147

View File

@@ -21,8 +21,7 @@ lsp_zero.format_on_save({
}, },
}) })
-- LSP: go -- LSP: go
local lspconfig = require('lspconfig') vim.lsp.config("gopls", {
lspconfig.gopls.setup({
settings = { settings = {
gopls = { gopls = {
analyses = { analyses = {
@@ -33,6 +32,7 @@ lspconfig.gopls.setup({
} }
} }
}) })
vim.lsp.enable({ "gopls" })
-- GO: Automatically organize imports on save -- GO: Automatically organize imports on save
vim.api.nvim_create_autocmd("BufWritePre", { vim.api.nvim_create_autocmd("BufWritePre", {
@@ -59,7 +59,7 @@ vim.api.nvim_create_autocmd("BufWritePre", {
}) })
-- LSP: nix -- LSP: nix
lspconfig.nil_ls.setup({ vim.lsp.config("nil_ls", {
autostart = true, autostart = true,
settings = { settings = {
['nil'] = { ['nil'] = {
@@ -69,9 +69,10 @@ lspconfig.nil_ls.setup({
}, },
}, },
}) })
vim.lsp.enable({ "nil_ls" })
-- LSP: lua -- LSP: lua
lspconfig.lua_ls.setup({ vim.lsp.config("lua_ls", {
on_init = function(client) on_init = function(client)
local path = client.workspace_folders[1].name local path = client.workspace_folders[1].name
if vim.loop.fs_stat(path .. '/.luarc.json') or vim.loop.fs_stat(path .. '/.luarc.jsonc') then if vim.loop.fs_stat(path .. '/.luarc.json') or vim.loop.fs_stat(path .. '/.luarc.jsonc') then
@@ -110,9 +111,11 @@ lspconfig.lua_ls.setup({
} }
} }
}) })
vim.lsp.enable({ "lua_ls" })
-- LSP: ts/js -- LSP: ts/js
lspconfig.ts_ls.setup({ vim.lsp.config("ts_ls", {
init_options = { init_options = {
plugins = { plugins = {
}, },
@@ -123,16 +126,13 @@ lspconfig.ts_ls.setup({
"typescriptreact", "typescriptreact",
}, },
}) })
vim.lsp.enable({ "ts_ls" })
-- LSP: rust
lspconfig.rust_analyzer.setup {
}
-- LSP: python -- LSP: python
-- Ruff server -- Ruff server
lspconfig.ruff.setup({ vim.lsp.config("ruff", {
}) })
vim.lsp.enable({ "ruff" })
-- Ruff: automatically format on save -- Ruff: automatically format on save
vim.api.nvim_create_autocmd("BufWritePre", { vim.api.nvim_create_autocmd("BufWritePre", {
@@ -159,7 +159,7 @@ vim.api.nvim_create_autocmd("LspAttach", {
}) })
-- Pyright -- Pyright
lspconfig.pyright.setup { vim.lsp.config("pyright", {
settings = { settings = {
pyright = { pyright = {
-- Using Ruff's import organizer -- Using Ruff's import organizer
@@ -172,13 +172,8 @@ lspconfig.pyright.setup {
}, },
}, },
}, },
} })
vim.lsp.enable({ "pyright" })
-- LSP: C/C++
lspconfig.clangd.setup({})
-- LSP: zig
lspconfig.zls.setup({})
-- Telescope -- Telescope
require('telescope').setup({ require('telescope').setup({