Change some diagnostics defaults

When loading diagnostics:
  * Disable underlining.  It is uncomfortable to have all the syntax
    highlighting changed because of the underline effect.
  * Also advice on diagnostics while typing (Insert Mode).
  * Show diagnostics menu on hold but only when editing, otherwise there
    is a keybinding available.
This commit is contained in:
Dionisio E Alonso 2021-07-20 18:40:13 -03:00
parent c3eb1d37f8
commit f95a29f371
1 changed files with 6 additions and 2 deletions

View File

@ -39,9 +39,13 @@ lua << EOF
local nvim_lsp = require('lspconfig')
local on_attach = function(client, bufnr)
vim.api.nvim_command('autocmd CursorHold <buffer> lua vim.lsp.diagnostic.show_line_diagnostics()')
vim.api.nvim_command('autocmd CursorHoldI <buffer> lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false})')
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {virtual_text=false}
vim.lsp.diagnostic.on_publish_diagnostics, {
update_in_insert = true,
underline = false,
virtual_text = false
}
)
require('compe').setup({autocomplete=true}, 0)
lsp_mappings()