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