From 02a1c77cad04e16005b8ab2ce18617b0ffa278b7 Mon Sep 17 00:00:00 2001 From: Nanderty Date: Fri, 24 Mar 2023 10:30:18 +0100 Subject: diagnostics and linting --- lua/plugins/lsp.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lua/plugins/lsp.lua') diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 68da19a..6ad37c3 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -33,6 +33,25 @@ return { local hl = "DiagnosticSign" .. type vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) end + vim.diagnostic.config({ + update_in_insert = true, + virtual_text = false, + }) + vim.api.nvim_create_autocmd("CursorHold", { + buffer = bufnr, + callback = function() + local opts = { + header = '', + source = 'always', + border = {{' '},{' '},{' '},{' '}}, + focusable = false, + close_events = { "BufLeave", "CursorMoved", "InsertEnter", }, + prefix = ' ', + scope = 'cursor', + } + vim.diagnostic.open_float(nil, opts) + end + }) end, }, } -- cgit v1.2.3