From 65a2690d603dee13c69459cc0e51e85d15f9a8aa Mon Sep 17 00:00:00 2001 From: z3rOR0ne Date: Sun, 25 Feb 2024 13:56:06 -0800 Subject: [PATCH] :wrench: Added space+e for floating window diagnostics --- .config/nvim/after/plugin/lsp.lua | 43 +++++++++++++++++++------------ 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index 82bfaa76..57bfe2c9 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -51,26 +51,35 @@ end SetAutoCmp(Mode) lsp.setup() +-- configure diagnostic lsp err msgs vim.diagnostic.config({ + underline = true, virtual_text = true, + float = { + source = "always", + focusable = false, + }, }) +-- toggles floating error messages +vim.keymap.set("n", "e", "lua vim.diagnostic.open_float()") + -- LSP Specific Settings -- Volar TypeScript Config (turn off for Vue with Vanilla JS) --- require("mason-lspconfig").setup_handlers({ --- function(server_name) --- local server_config = {} --- if server_name == "volar" then --- server_config.filetypes = { "vue", "typescript", "javascript" } --- lspconfig.tsserver.setup({ --- ["disabled"] = true, --- }) --- lspconfig.volar.setup({ --- settings = { --- ["volar.takeOverMode.enabled"] = true, --- }, --- }) --- end --- lspconfig[server_name].setup(server_config) --- end, --- }) +require("mason-lspconfig").setup_handlers({ + function(server_name) + local server_config = {} + if server_name == "volar" then + server_config.filetypes = { "vue", "typescript", "javascript" } + lspconfig.tsserver.setup({ + ["disabled"] = true, + }) + lspconfig.volar.setup({ + settings = { + ["volar.takeOverMode.enabled"] = true, + }, + }) + end + lspconfig[server_name].setup(server_config) + end, +})