update status line highlighting

This commit is contained in:
ManjaroOne666 2018-11-01 12:21:28 +00:00
parent fad2cc602b
commit e045ee178b
1 changed files with 64 additions and 20 deletions

84
vimrc
View File

@ -690,7 +690,8 @@ function! GetLinterStatus(key) abort "{{{
if has_key(l:linter, a:key) if has_key(l:linter, a:key)
let l:statuscount = l:linter[a:key] let l:statuscount = l:linter[a:key]
endif endif
return l:statuscount " return l:statuscount
return 3
endfunction endfunction
"}}} "}}}
@ -1183,6 +1184,8 @@ augroup END
"}}} "}}}
" }}} " }}}
"}}}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #statusline {{{ " #statusline {{{
@ -1194,25 +1197,24 @@ 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:statusline = '' let l:statusline = l:separator
"buffer number "buffer number {{{
if a:isactive if a:isactive
let l:statusline .= '%#StatusLineBufferNrActive#' let l:statusline .= '%#StatusLineBufferNrActive#'
else else
let l:statusline .= '%#StatusLineBufferNr#' let l:statusline .= '%#StatusLineBufferNr#'
endif endif
let l:statusline .= ' %n %* ' let l:statusline .= ' %n ' . l:separator
"}}}
" file percentage {{{ " file percentage {{{
let l:statusline .= '%#FoldColumn# '
if a:isactive if a:isactive
let l:statusline .= '%#StatusLinePercentActive#' let l:statusline .= '%#StatusLinePercentActive#'
let l:statusline .= '%P %#StatusLineDirActive#of %#StatusLineFileActive#%L %* ' let l:statusline .= ' %P %#StatusLineDirActive#of %#StatusLineFileActive#%L '
else else
let l:statusline .= '%#StatusLinePercent#' let l:statusline .= '%#StatusLinePercent#'
let l:statusline .= '%P %#StatusLineDir#of %#StatusLinePercent#%L %* ' let l:statusline .= ' %P %#StatusLineDir#of %#StatusLinePercent#%L '
endif"}}} endif"}}}
" non-empty buftype (help, quickfix, etc) {{{ " non-empty buftype (help, quickfix, etc) {{{
@ -1240,8 +1242,6 @@ function! GetStatus(isactive) abort "{{{
endif endif
let l:statusline.= l:separator . '%*%=' let l:statusline.= l:separator . '%*%='
let l:statusline .= ' '
"}}} "}}}
" file info{{{ " file info{{{
@ -1271,7 +1271,7 @@ 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 .= '%#InterfaceSignWarning# %R ' let l:statusline .= '%#StatusLineWarningActive# %R '
else else
let l:statusline.='%#StatusLineDir# ' let l:statusline.='%#StatusLineDir# '
let l:statusline.="%{fnamemodify(expand('%:p:h'),':~')}/" let l:statusline.="%{fnamemodify(expand('%:p:h'),':~')}/"
@ -1283,7 +1283,7 @@ 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 .= '%#LinterWarningInactive# %R ' let l:statusline .= '%#StatusLineWarning# %R '
endif endif
let l:statusline.='%*' let l:statusline.='%*'
"}}} "}}}
@ -1331,19 +1331,63 @@ function! GetStatus(isactive) abort "{{{
endif endif
"}}} "}}}
let l:statusline .= ' ' . l:separator
return l:statusline return l:statusline
endfunction endfunction
"}}} "}}}
"augroup status "{{{ " highlight groups {{{
" autocmd! hi TESTXX guifg=#ffffff guibg=#ff0000
" autocmd WinNew,WinEnter * setlocal statusline=%!GetStatus(1)
" autocmd WinLeave * setlocal statusline=%!GetStatus(0) hi def link StatusLineSeparator Ignore
" " autocmd WinNew * setlocal statusline=%!GetStatus(1) hi def link StatusLineNormal StatusLineNC
" " autocmd InsertChange * setlocal statusline=%!GetStatus(1) hi def link StatusLineActive StatusLine
"augroup END hi def link StatusLineNormalNoText TabLineFill
""}}} hi def link StatusLineActiveNoText TabLineFill
hi def link StatusLineBufferNr StatusLineNormal
hi def link StatusLineBufferNrActive StatusLineActive
hi def link StatusLineDiv TabLineFill
hi StatusLineDivActive ctermbg=darkgray ctermfg=darkgray guibg=#999999 guifg=#999999
hi StatusLineDivMod ctermbg=darkred ctermfg=darkred guibg=#aa0000 guifg=#aa0000
hi StatusLineDivModActive ctermbg=red ctermfg=red guibg=#ff0000 guifg=#ff0000
hi StatusLineDivInput ctermbg=darkblue ctermfg=darkblue guibg=#000022 guifg=#000022
" hi def link StatusLineFile
" hi def link StatusLineFileActive
" hi def link StatusLineDir
" hi def link StatusLineDirActive
" hi def link StatusLineDot
" hi def link StatusLineDotActive
" hi def link StatusLineExt
" hi def link StatusLineExtActive
" hi def link StatusLineWarning
" hi def link StatusLineWarningActive
" hi def link LinterDash
" hi def link LinterDashActive
" hi def link LinterError
" hi def link LinterErrorInactive
" hi def link LinterErrorStyle
" hi def link LinterErrorStyleInactive
" hi def link LinterWarning
" hi def link LinterWarningInactive
" hi def link LinterWarningStyle
" hi def link LinterWarningStyleInactive
" hi def link LinterInfo
" hi def link Linter
"}}}
augroup status "{{{
autocmd!
autocmd WinNew,WinEnter * setlocal statusline=%!GetStatus(1)
autocmd WinLeave * setlocal statusline=%!GetStatus(0)
" autocmd WinNew * setlocal statusline=%!GetStatus(1)
" autocmd InsertChange * setlocal statusline=%!GetStatus(1)
augroup END
"}}} "}}}
"}}} "}}}