customise lsp diagnostics

This commit is contained in:
Ray Elliott 2021-10-06 11:26:20 +01:00
commit 9df6cad0e2
2 changed files with 22 additions and 0 deletions

17
lua/init-lsp.lua Normal file
View file

@ -0,0 +1,17 @@
vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = {
prefix = '', -- Could be '■', '▎', 'x'
source = 'always',
},
-- signs = true,
underline = false,
update_in_insert = false,
})
vim.cmd [[
sign define LspDiagnosticsSignError text= texthl= linehl= numhl=LspDiagnosticsLineNrError
sign define LspDiagnosticsSignWarning text= texthl= linehl= numhl=LspDiagnosticsLineNrWarning
sign define LspDiagnosticsSignInfo text= texthl= linehl= numhl=LspDiagnosticsLineNrInformation
sign define LspDiagnosticsSignHint text= texthl= linehl= numhl=LspDiagnosticsLineNrHint
]]