From 3ea96709fcd2c76200bdfb8e0de9739caa108d17 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Sat, 26 Feb 2022 12:35:42 +0100 Subject: set spaces for go, update lsp config for diagnostic --- lua/alpha/lsp.lua | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'lua/alpha') diff --git a/lua/alpha/lsp.lua b/lua/alpha/lsp.lua index 5133edf..aa06eb3 100644 --- a/lua/alpha/lsp.lua +++ b/lua/alpha/lsp.lua @@ -53,15 +53,18 @@ lsp_installer.on_server_ready(function(server) vim.cmd [[ do User LspAttachBuffers ]] end) -require "lspconfig".efm.setup { - init_options = {documentFormatting = true}, - settings = { - rootMarkers = {".git/"}, - languages = { - blade = { - {formatCommand = "blade-formatter --stdin", formatStdin = true} - }, - json = {} - } + +vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( + vim.lsp.diagnostic.on_publish_diagnostics, { + underline = true, + update_in_insert = false, + virtual_text = { spacing = 2, prefix = "●" }, + severity_sort = true, } -} +) + +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 = "" }) +end -- cgit v1.2.3