[neovim] Disable LSP

This commit is contained in:
seajee
2025-05-23 21:53:36 +02:00
parent 02bd5bc375
commit 057688159c

View File

@@ -271,63 +271,63 @@ require("lazy").setup({
}, },
-- LSP -- LSP
{ -- {
"VonHeikemen/lsp-zero.nvim", -- "VonHeikemen/lsp-zero.nvim",
dependencies = { -- dependencies = {
"williamboman/mason.nvim", -- "williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim", -- "williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig", -- "neovim/nvim-lspconfig",
"hrsh7th/cmp-nvim-lsp", -- "hrsh7th/cmp-nvim-lsp",
"hrsh7th/nvim-cmp", -- "hrsh7th/nvim-cmp",
"hrsh7th/cmp-buffer", -- "hrsh7th/cmp-buffer",
"L3MON4D3/LuaSnip", -- "L3MON4D3/LuaSnip",
}, -- },
branch = "v3.x", -- branch = "v3.x",
config = function() -- config = function()
local lsp_zero = require("lsp-zero") -- local lsp_zero = require("lsp-zero")
lsp_zero.on_attach(function(client, bufnr) -- lsp_zero.on_attach(function(client, bufnr)
-- LSP keymaps -- -- LSP keymaps
lsp_zero.default_keymaps({ buffer = bufnr }) -- lsp_zero.default_keymaps({ buffer = bufnr })
--
local toggle_diagnostics = function() -- local toggle_diagnostics = function()
vim.diagnostic.enable(not vim.diagnostic.is_enabled()) -- vim.diagnostic.enable(not vim.diagnostic.is_enabled())
end -- end
vim.diagnostic.enable(false) -- vim.diagnostic.enable(false)
-- vim.diagnostic.config({ virtual_lines = true }) -- -- vim.diagnostic.config({ virtual_lines = true })
vim.diagnostic.config({ virtual_text = true }) -- vim.diagnostic.config({ virtual_text = true })
--
vim.keymap.set("n", "gr", "<cmd>Telescope lsp_references<cr>", { buffer = bufnr }) -- vim.keymap.set("n", "gr", "<cmd>Telescope lsp_references<cr>", { buffer = bufnr })
vim.keymap.set("n", "<leader>td", toggle_diagnostics) -- vim.keymap.set("n", "<leader>td", toggle_diagnostics)
end) -- end)
lsp_zero.set_server_config({ -- lsp_zero.set_server_config({
on_init = function(client) -- on_init = function(client)
client.server_capabilities.semanticTokensProvider = nil -- client.server_capabilities.semanticTokensProvider = nil
end, -- end,
}) -- })
--
require("mason").setup({}) -- require("mason").setup({})
require("mason-lspconfig").setup({ -- require("mason-lspconfig").setup({
ensure_installed = {"lua_ls", "clangd"}, -- ensure_installed = {"lua_ls", "clangd"},
handlers = { -- handlers = {
function(server_name) -- function(server_name)
require("lspconfig")[server_name].setup({}) -- require("lspconfig")[server_name].setup({})
end -- end
} -- }
}) -- })
--
local cmp = require("cmp") -- local cmp = require("cmp")
local cmp_format = require("lsp-zero").cmp_format({ details = true }) -- local cmp_format = require("lsp-zero").cmp_format({ details = true })
--
cmp.setup({ -- cmp.setup({
completion = { -- completion = {
autocomplete = false -- autocomplete = false
}, -- },
sources = { -- sources = {
{ name = "nvim_lsp" }, -- { name = "nvim_lsp" },
{ name = "buffer" }, -- { name = "buffer" },
}, -- },
formatting = cmp_format, -- formatting = cmp_format,
}) -- })
end -- end
} -- }
}) })