summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--nvim/.config/nvim/lua/plugins/lspconfig.lua56
1 files changed, 41 insertions, 15 deletions
diff --git a/nvim/.config/nvim/lua/plugins/lspconfig.lua b/nvim/.config/nvim/lua/plugins/lspconfig.lua
index 18108a5..d26665a 100644
--- a/nvim/.config/nvim/lua/plugins/lspconfig.lua
+++ b/nvim/.config/nvim/lua/plugins/lspconfig.lua
@@ -84,17 +84,13 @@ return {
 
         config = function()
 
-        local signs = {
-            Error = " ",
-            Warn = " ",
-            Hint = " ",
-            Info = " "
-        }
+        local x = vim.diagnostic.severity
 
-        for type, icon in pairs(signs) do
-            local hl = "DiagnosticSign" .. type
-            vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
-        end
+        vim.diagnostic.config {
+          virtual_text = { prefix = "" },
+          signs = { text = { [x.ERROR] = " ", [x.WARN] = " ", [x.INFO] = " ", [x.HINT] = "H "} },
+          underline = true,
+        }
 
         local cmp = require("cmp")
 
@@ -184,11 +180,41 @@ return {
     },
 
     {
-        "folke/trouble.nvim",
-        dependencies = { "nvim-tree/nvim-web-devicons" },
-        config = function()
-          vim.keymap.set("n", "<C-c>", ":TroubleToggle<CR>")
-        end,
+      "folke/trouble.nvim",
+      opts = {}, -- for default options, refer to the configuration section for custom setup.
+      cmd = "Trouble",
+      keys = {
+        {
+          "<leader>xx",
+          "<cmd>Trouble diagnostics toggle<cr>",
+          desc = "Diagnostics (Trouble)",
+        },
+        {
+          "<leader>xX",
+          "<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
+          desc = "Buffer Diagnostics (Trouble)",
+        },
+        {
+          "<leader>cs",
+          "<cmd>Trouble symbols toggle focus=false<cr>",
+          desc = "Symbols (Trouble)",
+        },
+        {
+          "<leader>cl",
+          "<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
+          desc = "LSP Definitions / references / ... (Trouble)",
+        },
+        {
+          "<leader>xL",
+          "<cmd>Trouble loclist toggle<cr>",
+          desc = "Location List (Trouble)",
+        },
+        {
+          "<leader>xQ",
+          "<cmd>Trouble qflist toggle<cr>",
+          desc = "Quickfix List (Trouble)",
+        },
+      },
     },
 
 }