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