-- Learn the keybindings, see :help lsp-zero-keybindings -- Learn to configure LSP servers, see :help lsp-zero-api-showcase local lsp = require("lsp-zero") lsp.preset({ manage_nvim_cmp = { set_sources = "lsp", }, }) lsp.ensure_installed({ "tsserver", "eslint", "lua_ls", "rust_analyzer", "gopls", }) local cmp = require("cmp") local cmp_select = { behaviour = cmp.SelectBehavior.Select } local cmp_mappings = lsp.defaults.cmp_mappings({ ["vws", function() vim.lsp.buf.workspace_symbol() end, opts) vim.keymap.set("n", "vd", function() vim.lsp.diagnostic.open_float() end, opts) vim.keymap.set("n", "[d", function() vim.lsp.diagnostic.goto_next() end, opts) vim.keymap.set("n", "]d", function() vim.lsp.diagnostic.goto_prev() end, opts) vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts) vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) end) lsp.setup() vim.diagnostic.config({ virtual_text = true, signs = false, update_in_insert = false, underline = true, severity_sort = true, float = { focusable = false, style = "minimal", border = "rounded", source = "always", header = "", prefix = "", }, })