customise lsp diagnostics

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

View File

@ -9,6 +9,11 @@ source ~/.config/nvim/init.tabline.vim
source ~/.config/nvim/init.auto-window.vim source ~/.config/nvim/init.auto-window.vim
source ~/.config/nvim/init.fold-text.vim source ~/.config/nvim/init.fold-text.vim
source ~/.config/nvim/init.commands.vim source ~/.config/nvim/init.commands.vim
"
" require lua init modules
lua <<EOF
require('init-lsp')
EOF
" TODO - maybe separate some of these into own files too " TODO - maybe separate some of these into own files too
" #functions {{{ " #functions {{{

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
]]