From 0e307866172477172faa7d2003c5b09ae0d0db7c Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Fri, 10 Dec 2021 17:10:28 -0800 Subject: [PATCH] Add trouble --- neovim/lua/plugins.lua | 10 ++++------ neovim/lua/plugins/lsp.lua | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/neovim/lua/plugins.lua b/neovim/lua/plugins.lua index 1a7caff..f85a226 100644 --- a/neovim/lua/plugins.lua +++ b/neovim/lua/plugins.lua @@ -153,12 +153,10 @@ return require('packer').startup(function(use) -- LSP -- Configure language servers - use { - "neovim/nvim-lspconfig", - requires = { - "jose-elias-alvarez/null-ls.nvim", - }, - } + use "neovim/nvim-lspconfig" + + -- Better display of diagnostics + use "folke/trouble.nvim" -- Generic linter/formatters in diagnostics API use { diff --git a/neovim/lua/plugins/lsp.lua b/neovim/lua/plugins/lsp.lua index c07faa9..b2805a3 100644 --- a/neovim/lua/plugins/lsp.lua +++ b/neovim/lua/plugins/lsp.lua @@ -24,12 +24,25 @@ function M.config_lsp_ui() end -- Diagnostics signs - local signs = { Error = "🔥", Warn = "⚠️", Hint = "🤔", Info = "📝" } + local signs = { Error = "🔥", Warn = "⚠️", Hint = "🤔", Info = "➞" } for type, icon in pairs(signs) do local hl = "DiagnosticSign" .. type vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) end + if utils.is_plugin_loaded("trouble") then + require("trouble").setup { + fold_open = "▼", + fold_closed = "▶", + signs = { + error = signs.Error, + warning = signs.Warning, + hint = signs.Hint, + information = signs.Info, + other = "", + }, + } + end end local function default_attach(client, bufnr)