@@ -671,15 +671,34 @@ require('lazy').setup({
671
671
end ,
672
672
})
673
673
674
- -- Change diagnostic symbols in the sign column (gutter)
675
- -- if vim.g.have_nerd_font then
676
- -- local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' }
677
- -- local diagnostic_signs = {}
678
- -- for type, icon in pairs(signs) do
679
- -- diagnostic_signs[vim.diagnostic.severity[type]] = icon
680
- -- end
681
- -- vim.diagnostic.config { signs = { text = diagnostic_signs } }
682
- -- end
674
+ -- Diagnostic Config
675
+ -- See :help vim.diagnostic.Opts
676
+ vim .diagnostic .config {
677
+ severity_sort = true ,
678
+ float = { border = ' rounded' , source = ' if_many' },
679
+ underline = { severity = vim .diagnostic .severity .ERROR },
680
+ signs = vim .g .have_nerd_font and {
681
+ text = {
682
+ [vim .diagnostic .severity .ERROR ] = ' ' ,
683
+ [vim .diagnostic .severity .WARN ] = ' ' ,
684
+ [vim .diagnostic .severity .INFO ] = ' ' ,
685
+ [vim .diagnostic .severity .HINT ] = ' ' ,
686
+ },
687
+ } or {},
688
+ virtual_text = {
689
+ source = ' if_many' ,
690
+ spacing = 2 ,
691
+ format = function (diagnostic )
692
+ local diagnostic_message = {
693
+ [vim .diagnostic .severity .ERROR ] = diagnostic .message ,
694
+ [vim .diagnostic .severity .WARN ] = diagnostic .message ,
695
+ [vim .diagnostic .severity .INFO ] = diagnostic .message ,
696
+ [vim .diagnostic .severity .HINT ] = diagnostic .message ,
697
+ }
698
+ return diagnostic_message [diagnostic .severity ]
699
+ end ,
700
+ },
701
+ }
683
702
684
703
-- LSP servers and clients are able to communicate to each other what features they support.
685
704
-- By default, Neovim doesn't support everything that is in the LSP specification.
0 commit comments