status line default highlighting

This commit is contained in:
ManjaroOne666 2018-11-01 16:37:17 +00:00
parent d454de9e31
commit 2adeef6d2c
1 changed files with 70 additions and 41 deletions

95
vimrc
View File

@ -1197,6 +1197,8 @@ function! GetStatus(isactive) abort "{{{
let l:separator = '%#StatusLineSeparator# ' let l:separator = '%#StatusLineSeparator# '
let l:normal = '%#StatusLineNormal#' let l:normal = '%#StatusLineNormal#'
let l:active = '%#StatusLineActive#' let l:active = '%#StatusLineActive#'
let l:linterdash = '%#LinterDash#·'
let l:linterdashactive = '%#LinterDashActive#·'
let l:statusline = l:separator let l:statusline = l:separator
"buffer number {{{ "buffer number {{{
@ -1253,14 +1255,29 @@ function! GetStatus(isactive) abort "{{{
let l:statusline.=' %{strlen(&fenc)?&fenc:&enc} ' let l:statusline.=' %{strlen(&fenc)?&fenc:&enc} '
" let l:statusline.=l:separator . l:active " let l:statusline.=l:separator . l:active
let l:statusline.=' %{&fileformat} ' let l:statusline.=' %{&fileformat} '
let l:statusline.=l:separator . l:active let l:statusline.="%{strlen(expand('%:e'))?expand('%:e'):expand('%:e')}"
" let l:statusline.=l:separator . l:active
" let l:statusline.=' %{&spelllang} ' " let l:statusline.=' %{&spelllang} '
" let l:statusline.=l:separator let l:statusline.=l:separator
endif endif
"}}} "}}}
" path/filename.extension {{{ " path/filename.extension {{{
if a:isactive if a:isactive
if &readonly
let l:statusline .= '%#StatusLineWarningActive# %r '
let l:statusline .= '%#StatusLineFileReadOnlyActive#'
" let l:statusline.='%#StatusLineDirActive# '
let l:statusline.="%{expand('%:p:h:t')}/"
" let l:statusline.='%#StatusLineFileActive#'
let l:statusline.="%{expand('%:t:r')}"
" let l:statusline.='%#StatusLineDotActive#'
let l:statusline.="%{strlen(expand('%:e'))?'.':''}"
" let l:statusline.='%#StatusLineExtActive#'
let l:statusline.="%{strlen(expand('%:e'))?expand('%:e'):expand('%:e')} "
else
let l:statusline.='%#StatusLineDirActive# ' let l:statusline.='%#StatusLineDirActive# '
let l:statusline.="%{expand('%:p:h:t')}/" let l:statusline.="%{expand('%:p:h:t')}/"
let l:statusline.='%#StatusLineFileActive#' let l:statusline.='%#StatusLineFileActive#'
@ -1271,8 +1288,9 @@ function! GetStatus(isactive) abort "{{{
let l:statusline.="%{strlen(expand('%:e'))?'.':''}" let l:statusline.="%{strlen(expand('%:e'))?'.':''}"
let l:statusline.='%#StatusLineExtActive#' let l:statusline.='%#StatusLineExtActive#'
let l:statusline.="%{strlen(expand('%:e'))?expand('%:e'):expand('%:e')} " let l:statusline.="%{strlen(expand('%:e'))?expand('%:e'):expand('%:e')} "
let l:statusline .= '%#StatusLineWarningActive# %R ' endif
else else
let l:statusline .= ' %#StatusLineFileReadOnly#%r'
let l:statusline.='%#StatusLineDir# ' let l:statusline.='%#StatusLineDir# '
let l:statusline.="%{fnamemodify(expand('%:p:h'),':~')}/" let l:statusline.="%{fnamemodify(expand('%:p:h'),':~')}/"
let l:statusline.='%#StatusLineFile#' let l:statusline.='%#StatusLineFile#'
@ -1283,51 +1301,51 @@ function! GetStatus(isactive) abort "{{{
let l:statusline.="%{strlen(expand('%:e'))?'.':''}" let l:statusline.="%{strlen(expand('%:e'))?'.':''}"
let l:statusline.='%#StatusLineExt#' let l:statusline.='%#StatusLineExt#'
let l:statusline.="%{strlen(expand('%:e'))?expand('%:e'):expand('%:e')} " let l:statusline.="%{strlen(expand('%:e'))?expand('%:e'):expand('%:e')} "
let l:statusline .= '%#StatusLineWarning# %R '
endif endif
let l:statusline.='%*'
"}}} "}}}
let l:statusline.='%*' . l:separator
" linter status {{{ " linter status {{{
if a:isactive if a:isactive
" errors " errors
let l:statusline .= "%#LinterDashActive#%{(GetLinterStatus('error') == 0?'-':'')}" let l:statusline .= "%#LinterDashActive#%{(GetLinterStatus('error') == 0?'-':'')}"
let l:statusline .= "%#LinterError#%{(GetLinterStatus('error') == 0?'':GetLinterStatus('error'))}" let l:statusline .= "%#LinterErrorActive#%{(GetLinterStatus('error') == 0?'':GetLinterStatus('error'))}"
" style errors " style errors
let l:statusline .= '%#LinterDash#|' let l:statusline .= l:linterdashactive
let l:statusline .= "%#LinterDashActive#%{(GetLinterStatus('style_error') == 0?'-':'')}" let l:statusline .= "%#LinterDashActive#%{(GetLinterStatus('style_error') == 0?'-':'')}"
let l:statusline .= "%#LinterErrorStyle#%{(GetLinterStatus('style_error') == 0?'':GetLinterStatus('style_error'))} " let l:statusline .= "%#LinterErrorStyleActive#%{(GetLinterStatus('style_error') == 0?'':GetLinterStatus('style_error'))} "
" warnings " warnings
let l:statusline .= "%#LinterDashActive#%{(GetLinterStatus('warning') == 0?'-':'')}" let l:statusline .= "%#LinterDashActive#%{(GetLinterStatus('warning') == 0?'-':'')}"
let l:statusline .= "%#LinterWarning#%{(GetLinterStatus('warning') == 0?'':GetLinterStatus('warning'))}" let l:statusline .= "%#LinterWarningActive#%{(GetLinterStatus('warning') == 0?'':GetLinterStatus('warning'))}"
" style warnings " style warnings
let l:statusline .= '%#LinterDash#|' let l:statusline .= l:linterdashactive
let l:statusline .= "%#LinterDashActive#%{(GetLinterStatus('style_warning') == 0?'-':'')}" let l:statusline .= "%#LinterDashActive#%{(GetLinterStatus('style_warning') == 0?'-':'')}"
let l:statusline .= "%#LinterWarningStyle#%{(GetLinterStatus('style_warning') == 0?'':GetLinterStatus('style_warning'))} " let l:statusline .= "%#LinterWarningStyleActive#%{(GetLinterStatus('style_warning') == 0?'':GetLinterStatus('style_warning'))} "
" info " info
let l:statusline .= "%#LinterDashActive#%{(GetLinterStatus('info') == 0?'-':'')}" let l:statusline .= "%#LinterDashActive#%{(GetLinterStatus('info') == 0?'-':'')}"
let l:statusline .= "%#LinterInfo#%{(GetLinterStatus('info') == 0?'':GetLinterStatus('info'))}" let l:statusline .= "%#LinterInfoActive#%{(GetLinterStatus('info') == 0?'':GetLinterStatus('info'))}"
else else
" errors " errors
let l:statusline .= "%#LinterDash#%{(GetLinterStatus('error') == 0?'-':'')}" let l:statusline .= "%#LinterDash#%{(GetLinterStatus('error') == 0?'-':'')}"
let l:statusline .= "%#LinterErrorInactive#%{(GetLinterStatus('error') == 0?'':GetLinterStatus('error'))}" let l:statusline .= "%#LinterError#%{(GetLinterStatus('error') == 0?'':GetLinterStatus('error'))}"
" style errors " style errors
let l:statusline .= '%#LinterDash#|' let l:statusline .= l:linterdash
let l:statusline .= "%{(GetLinterStatus('style_error') == 0?'-':'')}" let l:statusline .= "%{(GetLinterStatus('style_error') == 0?'-':'')}"
let l:statusline .= "%#LinterErrorStyleInactive#%{(GetLinterStatus('style_error') == 0?'':GetLinterStatus('style_error'))} " let l:statusline .= "%#LinterErrorStyle#%{(GetLinterStatus('style_error') == 0?'':GetLinterStatus('style_error'))} "
" warnings " warnings
let l:statusline .= "%#LinterDash#%{(GetLinterStatus('warning') == 0?'-':'')}" let l:statusline .= "%#LinterDash#%{(GetLinterStatus('warning') == 0?'-':'')}"
let l:statusline .= "%#LinterWarningInactive#%{(GetLinterStatus('warning') == 0?'':GetLinterStatus('warning'))}" let l:statusline .= "%#LinterWarning#%{(GetLinterStatus('warning') == 0?'':GetLinterStatus('warning'))}"
" style warnings " style warnings
let l:statusline .= '%#LinterDash#|' let l:statusline .= l:linterdash
let l:statusline .= "%{(GetLinterStatus('style_warning') == 0?'-':'')}" let l:statusline .= "%{(GetLinterStatus('style_warning') == 0?'-':'')}"
let l:statusline .= "%#LinterWarningStyleInactive#%{(GetLinterStatus('style_warning') == 0?'':GetLinterStatus('style_warning'))} " let l:statusline .= "%#LinterWarningStyle#%{(GetLinterStatus('style_warning') == 0?'':GetLinterStatus('style_warning'))} "
" info " info
let l:statusline .= "%#LinterDash#%{GetLinterStatus('info') == 0 ? '-' : GetLinterStatus('info')}" let l:statusline .= "%#LinterInfo#%{GetLinterStatus('info') == 0 ? '-' : GetLinterStatus('info')}"
endif endif
"}}} "}}}
@ -1376,21 +1394,32 @@ hi def link StatusLineDot StatusLineDir
hi def link StatusLineDotActive StatusLineDirActive hi def link StatusLineDotActive StatusLineDirActive
hi def link StatusLineExt StatusLineDir hi def link StatusLineExt StatusLineDir
hi def link StatusLineExtActive StatusLineDirActive hi def link StatusLineExtActive StatusLineDirActive
" hi def link StatusLineWarning
" hi def link StatusLineWarningActive
hi def link LinterDash StatusLineNoise hi def link StatusLineFileReadOnly StatusLineNormal
" hi def link LinterDashActive hi def link StatusLineFileReadOnlyActive WarningMsg
" hi def link LinterError hi def link StatusLineWarning Normal
" hi def link LinterErrorInactive hi def link StatusLineWarningActive WarningMsg
" hi def link LinterErrorStyle
" hi def link LinterErrorStyleInactive hi TESTXX guibg=#ff0000 guifg=#ffffff
" hi def link LinterWarning hi def link Linter TESTXX
" hi def link LinterWarningInactive
" hi def link LinterWarningStyle hi def link LinterDash Normal
" hi def link LinterWarningStyleInactive hi def link LinterDashActive Normal
" hi def link LinterInfo
" hi def link Linter hi def link LinterError Normal
hi def link LinterErrorActive ErrorMsg
hi def link LinterErrorStyle Normal
hi def link LinterErrorStyleActive SpellBad
hi def link LinterWarning Normal
hi def link LinterWarningActive SpellCap
hi def link LinterWarningStyle Normal
hi def link LinterWarningStyleActive LinterWarningActive
hi def link LinterInfo Normal
hi def link LinterInfoActive SpellRare
"}}} "}}}
augroup status "{{{ augroup status "{{{