update status line highlighting
This commit is contained in:
parent
fad2cc602b
commit
e045ee178b
84
vimrc
84
vimrc
|
@ -690,7 +690,8 @@ function! GetLinterStatus(key) abort "{{{
|
|||
if has_key(l:linter, a:key)
|
||||
let l:statuscount = l:linter[a:key]
|
||||
endif
|
||||
return l:statuscount
|
||||
" return l:statuscount
|
||||
return 3
|
||||
endfunction
|
||||
"}}}
|
||||
|
||||
|
@ -1183,6 +1184,8 @@ augroup END
|
|||
"}}}
|
||||
" }}}
|
||||
|
||||
"}}}
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
" #statusline {{{
|
||||
|
@ -1194,25 +1197,24 @@ function! GetStatus(isactive) abort "{{{
|
|||
let l:separator = '%#StatusLineSeparator# '
|
||||
let l:normal = '%#StatusLineNormal#'
|
||||
let l:active = '%#StatusLineActive#'
|
||||
let l:statusline = ''
|
||||
let l:statusline = l:separator
|
||||
|
||||
"buffer number
|
||||
"buffer number {{{
|
||||
if a:isactive
|
||||
let l:statusline .= '%#StatusLineBufferNrActive#'
|
||||
else
|
||||
let l:statusline .= '%#StatusLineBufferNr#'
|
||||
endif
|
||||
let l:statusline .= ' %n %* '
|
||||
|
||||
let l:statusline .= ' %n ' . l:separator
|
||||
"}}}
|
||||
|
||||
" file percentage {{{
|
||||
let l:statusline .= '%#FoldColumn# '
|
||||
if a:isactive
|
||||
let l:statusline .= '%#StatusLinePercentActive#'
|
||||
let l:statusline .= '%P %#StatusLineDirActive#of %#StatusLineFileActive#%L %* '
|
||||
let l:statusline .= ' %P %#StatusLineDirActive#of %#StatusLineFileActive#%L '
|
||||
else
|
||||
let l:statusline .= '%#StatusLinePercent#'
|
||||
let l:statusline .= '%P %#StatusLineDir#of %#StatusLinePercent#%L %* '
|
||||
let l:statusline .= ' %P %#StatusLineDir#of %#StatusLinePercent#%L '
|
||||
endif"}}}
|
||||
|
||||
" non-empty buftype (help, quickfix, etc) {{{
|
||||
|
@ -1240,8 +1242,6 @@ function! GetStatus(isactive) abort "{{{
|
|||
endif
|
||||
|
||||
let l:statusline.= l:separator . '%*%='
|
||||
|
||||
let l:statusline .= ' '
|
||||
"}}}
|
||||
|
||||
" file info{{{
|
||||
|
@ -1271,7 +1271,7 @@ function! GetStatus(isactive) abort "{{{
|
|||
let l:statusline.="%{strlen(expand('%:e'))?'.':''}"
|
||||
let l:statusline.='%#StatusLineExtActive#'
|
||||
let l:statusline.="%{strlen(expand('%:e'))?expand('%:e'):expand('%:e')} "
|
||||
let l:statusline .= '%#InterfaceSignWarning# %R '
|
||||
let l:statusline .= '%#StatusLineWarningActive# %R '
|
||||
else
|
||||
let l:statusline.='%#StatusLineDir# '
|
||||
let l:statusline.="%{fnamemodify(expand('%:p:h'),':~')}/"
|
||||
|
@ -1283,7 +1283,7 @@ function! GetStatus(isactive) abort "{{{
|
|||
let l:statusline.="%{strlen(expand('%:e'))?'.':''}"
|
||||
let l:statusline.='%#StatusLineExt#'
|
||||
let l:statusline.="%{strlen(expand('%:e'))?expand('%:e'):expand('%:e')} "
|
||||
let l:statusline .= '%#LinterWarningInactive# %R '
|
||||
let l:statusline .= '%#StatusLineWarning# %R '
|
||||
endif
|
||||
let l:statusline.='%*'
|
||||
"}}}
|
||||
|
@ -1331,19 +1331,63 @@ function! GetStatus(isactive) abort "{{{
|
|||
endif
|
||||
"}}}
|
||||
|
||||
let l:statusline .= ' ' . l:separator
|
||||
|
||||
return l:statusline
|
||||
|
||||
endfunction
|
||||
"}}}
|
||||
|
||||
"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
|
||||
""}}}
|
||||
" highlight groups {{{
|
||||
hi TESTXX guifg=#ffffff guibg=#ff0000
|
||||
|
||||
hi def link StatusLineSeparator Ignore
|
||||
hi def link StatusLineNormal StatusLineNC
|
||||
hi def link StatusLineActive StatusLine
|
||||
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
|
||||
"}}}
|
||||
|
||||
"}}}
|
||||
|
|
Loading…
Reference in New Issue