@@ -646,15 +646,34 @@ require('lazy').setup({
646646 end ,
647647 })
648648
649- -- Change diagnostic symbols in the sign column (gutter)
650- -- if vim.g.have_nerd_font then
651- -- local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' }
652- -- local diagnostic_signs = {}
653- -- for type, icon in pairs(signs) do
654- -- diagnostic_signs[vim.diagnostic.severity[type]] = icon
655- -- end
656- -- vim.diagnostic.config { signs = { text = diagnostic_signs } }
657- -- end
649+ -- Diagnostic Config
650+ -- See :help vim.diagnostic.Opts
651+ vim .diagnostic .config {
652+ severity_sort = true ,
653+ float = { border = ' rounded' , source = ' if_many' },
654+ underline = { severity = vim .diagnostic .severity .ERROR },
655+ signs = vim .g .have_nerd_font and {
656+ text = {
657+ [vim .diagnostic .severity .ERROR ] = ' ' ,
658+ [vim .diagnostic .severity .WARN ] = ' ' ,
659+ [vim .diagnostic .severity .INFO ] = ' ' ,
660+ [vim .diagnostic .severity .HINT ] = ' ' ,
661+ },
662+ } or {},
663+ virtual_text = {
664+ source = ' if_many' ,
665+ spacing = 2 ,
666+ format = function (diagnostic )
667+ local diagnostic_message = {
668+ [vim .diagnostic .severity .ERROR ] = diagnostic .message ,
669+ [vim .diagnostic .severity .WARN ] = diagnostic .message ,
670+ [vim .diagnostic .severity .INFO ] = diagnostic .message ,
671+ [vim .diagnostic .severity .HINT ] = diagnostic .message ,
672+ }
673+ return diagnostic_message [diagnostic .severity ]
674+ end ,
675+ },
676+ }
658677
659678 -- LSP servers and clients are able to communicate to each other what features they support.
660679 -- By default, Neovim doesn't support everything that is in the LSP specification.
0 commit comments