From 49c1f84e6e1cf0b026d1e0b2b910a40c19b56b76 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Wed, 5 May 2021 07:20:42 +0530 Subject: [PATCH] better LspDiagnostics icons and colors --- lua/compe-completion.lua | 2 +- lua/nvim-lspconfig.lua | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/lua/compe-completion.lua b/lua/compe-completion.lua index 1e0ec99..0fa3ecd 100644 --- a/lua/compe-completion.lua +++ b/lua/compe-completion.lua @@ -15,7 +15,7 @@ require "compe".setup { documentation = true, source = { path = true, - buffer = true, + buffer = {kind = "﬘" , true}, calc = true, vsnip = {kind = "﬌"}, --replace to what sign you prefer nvim_lsp = true, diff --git a/lua/nvim-lspconfig.lua b/lua/nvim-lspconfig.lua index 0c1b86e..d8e2f59 100644 --- a/lua/nvim-lspconfig.lua +++ b/lua/nvim-lspconfig.lua @@ -36,7 +36,7 @@ function on_attach(client) end local lspconf = require "lspconfig" -local servers = {"html", "cssls", "tsserver", "pyright" , "bashls"} +local servers = {"html", "cssls", "tsserver", "pyright", "bashls"} for k, lang in pairs(servers) do lspconf[lang].setup { @@ -78,7 +78,23 @@ require "lspconfig".sumneko_lua.setup { } -- replace the default lsp diagnostic letters with prettier symbols -vim.fn.sign_define("LspDiagnosticsSignError", {text = "", numhl = "LspDiagnosticsDefaultError"}) -vim.fn.sign_define("LspDiagnosticsSignWarning", {text = "", numhl = "LspDiagnosticsDefaultWarning"}) -vim.fn.sign_define("LspDiagnosticsSignInformation", {text = "", numhl = "LspDiagnosticsDefaultInformation"}) -vim.fn.sign_define("LspDiagnosticsSignHint", {text = "", numhl = "LspDiagnosticsDefaultHint"}) +vim.fn.sign_define("LspDiagnosticsSignError", {text = "", numhl = "LspDiagnosticsDefaultError"}) +vim.fn.sign_define("LspDiagnosticsSignWarning", {text = "", numhl = "LspDiagnosticsDefaultWarning"}) +vim.fn.sign_define("LspDiagnosticsSignInformation", {text = "", numhl = "LspDiagnosticsDefaultInformation"}) +vim.fn.sign_define("LspDiagnosticsSignHint", {text = "", numhl = "LspDiagnosticsDefaultHint"}) + +-- diagnostics highlights + +local cmd = vim.cmd + +cmd "hi LspDiagnosticsSignError guifg=#f9929b" +cmd "hi LspDiagnosticsVirtualTextError guifg=#BF616A" + +cmd "hi LspDiagnosticsSignWarning guifg=#EBCB8B" +cmd "hi LspDiagnosticsVirtualTextWarning guifg=#EBCB8B" + +cmd "hi LspDiagnosticsSignInformation guifg=#A3BE8C" +cmd "hi LspDiagnosticsVirtualTextInformation guifg=#A3BE8C" + +cmd "hi LspDiagnosticsSignHint guifg=#b6bdca" +cmd "hi LspDiagnosticsVirtualTextHint guifg=#b6bdca"