Skip to content

Commit

Permalink
Merge pull request #178 from dietrichm/neovim-lsp-highlights
Browse files Browse the repository at this point in the history
Highlight Neovim (LSP) diagnostics
  • Loading branch information
NLKNguyen committed Oct 14, 2021
2 parents 86bfb48 + d764624 commit d0d32dc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions colors/PaperColor.vim
Original file line number Diff line number Diff line change
Expand Up @@ -907,16 +907,19 @@ fun! s:set_color_variables()
fun! s:create_color_variables(color_name, rich_color, term_color)
let {'s:fg_' . a:color_name} = ' guifg=' . a:rich_color[0] . ' '
let {'s:bg_' . a:color_name} = ' guibg=' . a:rich_color[0] . ' '
let {'s:sp_' . a:color_name} = ' guisp=' . a:rich_color[0] . ' '
endfun
elseif s:mode == s:MODE_256_COLOR
fun! s:create_color_variables(color_name, rich_color, term_color)
let {'s:fg_' . a:color_name} = ' ctermfg=' . a:rich_color[1] . ' '
let {'s:bg_' . a:color_name} = ' ctermbg=' . a:rich_color[1] . ' '
let {'s:sp_' . a:color_name} = ''
endfun
else
fun! s:create_color_variables(color_name, rich_color, term_color)
let {'s:fg_' . a:color_name} = ' ctermfg=' . a:term_color . ' '
let {'s:bg_' . a:color_name} = ' ctermbg=' . a:term_color . ' '
let {'s:sp_' . a:color_name} = ''
endfun
endif
" }}}
Expand Down Expand Up @@ -1240,6 +1243,28 @@ fun! s:apply_syntax_highlightings()
exec 'hi Title' . s:fg_comment
exec 'hi Global' . s:fg_blue

" Neovim (LSP) diagnostics
if has('nvim')
exec 'hi LspDiagnosticsDefaultError' . s:fg_error_fg . s:bg_error_bg
exec 'hi LspDiagnosticsDefaultWarning' . s:fg_todo_fg . s:bg_todo_bg . s:ft_bold
exec 'hi LspDiagnosticsDefaultInformation' . s:fg_todo_fg . s:bg_todo_bg . s:ft_bold
exec 'hi LspDiagnosticsDefaultHint' . s:fg_todo_fg . s:bg_todo_bg . s:ft_bold

exec 'hi LspDiagnosticsUnderlineError cterm=undercurl gui=undercurl' . s:sp_error_fg
exec 'hi LspDiagnosticsUnderlineWarning cterm=undercurl gui=undercurl' . s:sp_todo_fg
exec 'hi LspDiagnosticsUnderlineInformation cterm=undercurl gui=undercurl' . s:sp_todo_fg
exec 'hi LspDiagnosticsUnderlineHint cterm=undercurl gui=undercurl' . s:sp_todo_fg

hi! link DiagnosticError LspDiagnosticsDefaultError
hi! link DiagnosticWarn LspDiagnosticsDefaultWarning
hi! link DiagnosticInfo LspDiagnosticsDefaultInformation
hi! link DiagnosticHint LspDiagnosticsDefaultHint

hi! link DiagnosticUnderlineError LspDiagnosticsUnderlineError
hi! link DiagnosticUnderlineWarn LspDiagnosticsUnderlineWarning
hi! link DiagnosticUnderlineInfo LspDiagnosticsUnderlineInformation
hi! link DiagnosticUnderlineHint LspDiagnosticsUnderlineHint
endif

" Extension {{{
" VimL Highlighting
Expand Down

0 comments on commit d0d32dc

Please sign in to comment.