better status line
This commit is contained in:
parent
d4bc6393d3
commit
f6a748d67b
|
@ -194,27 +194,37 @@ hi TabLineSel ctermfg=250 guifg=#bcbcbc ctermbg=234 guibg=#1c1c1c
|
||||||
hi TabModified ctermfg=250 guifg=#bcbcbc ctermbg=234 guibg=#1c1c1c
|
hi TabModified ctermfg=250 guifg=#bcbcbc ctermbg=234 guibg=#1c1c1c
|
||||||
hi TabModifiedSelected ctermfg=255 guifg=#eeeeee ctermbg=234 guibg=#1c1c1c
|
hi TabModifiedSelected ctermfg=255 guifg=#eeeeee ctermbg=234 guibg=#1c1c1c
|
||||||
|
|
||||||
hi StatusLine ctermfg=255 guifg=#eeeeee ctermbg=240 guibg=#444444 term=none cterm=none
|
hi StatusLineNormal ctermfg=243 guifg=#777777 ctermbg=234 guibg=#1c1c1c term=none cterm=none
|
||||||
hi StatusLineNC ctermfg=238 guifg=#444444 ctermbg=233 guibg=#121212 term=none cterm=none
|
hi! def link StatusLine StatusLineNormal
|
||||||
|
hi StatusLineInput ctermfg=255 guifg=#ffffff ctermbg=239 guibg=#4e4e4e term=none cterm=none
|
||||||
|
hi StatusLineNC ctermfg=238 guifg=#444444 ctermbg=234 guibg=#1c1c1c term=none cterm=none
|
||||||
|
hi StatusLineSeparator ctermfg=232 guifg=#000000 ctermbg=232 guibg=#000000
|
||||||
hi StatusLineDir ctermfg=241 guifg=#666666 ctermbg=234 guibg=#1c1c1c
|
hi StatusLineDir ctermfg=241 guifg=#666666 ctermbg=234 guibg=#1c1c1c
|
||||||
hi StatusLineFile ctermfg=250 guifg=#cccccc ctermbg=234 guibg=#1c1c1c
|
hi StatusLineFile ctermfg=250 guifg=#cccccc ctermbg=234 guibg=#1c1c1c
|
||||||
|
hi StatusLineFileMod ctermfg=250 guifg=#cccccc ctermbg=88 guibg=#490000
|
||||||
hi StatusLineDot ctermfg=236 guifg=#4a4a4a ctermbg=234 guibg=#1c1c1c
|
hi StatusLineDot ctermfg=236 guifg=#4a4a4a ctermbg=234 guibg=#1c1c1c
|
||||||
hi StatusLineExt ctermfg=243 guifg=#777777 ctermbg=234 guibg=#1c1c1c
|
hi StatusLineExt ctermfg=243 guifg=#777777 ctermbg=234 guibg=#1c1c1c
|
||||||
hi StatusLineMod ctermfg=255 guifg=#ffffff ctermbg=88 guibg=#490000
|
hi StatusLineMod ctermfg=255 guifg=#ffffff ctermbg=88 guibg=#490000
|
||||||
|
|
||||||
|
function! DoInsertEnter()
|
||||||
|
hi! def link StatusLine StatusLineInput
|
||||||
|
set cursorline
|
||||||
|
hi LineNr ctermfg=235 guifg=#262626
|
||||||
|
hi CursorLineNr ctermfg=250 guifg=#bcbcbc
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! DoInsertLeave()
|
||||||
|
hi! def link StatusLine StatusLineNormal
|
||||||
|
set nocursorline
|
||||||
|
hi LineNr ctermfg=237 guifg=#3a3a3a
|
||||||
|
hi CursorLineNr ctermfg=243 guifg=#767676
|
||||||
|
endfunction
|
||||||
|
|
||||||
" set insert mode colours
|
" set insert mode colours
|
||||||
augroup statuscursorlines
|
augroup statuscursorlines
|
||||||
au InsertEnter * hi StatusLine ctermfg=233 guifg=#121212 ctermbg=255 guibg=#eeeeee
|
au!
|
||||||
au InsertLeave * hi StatusLine ctermfg=255 guifg=#eeeeee ctermbg=239 guibg=#4e4e4e
|
au InsertEnter * call DoInsertEnter()
|
||||||
|
au InsertLeave * call DoInsertLeave()
|
||||||
au InsertEnter * set cursorline
|
|
||||||
au InsertLeave * set nocursorline
|
|
||||||
|
|
||||||
au InsertEnter * hi LineNr ctermfg=235 guifg=#262626
|
|
||||||
au InsertLeave * hi LineNr ctermfg=237 guifg=#3a3a3a
|
|
||||||
|
|
||||||
au InsertEnter * hi CursorLineNr ctermfg=250 guifg=#bcbcbc
|
|
||||||
au InsertLeave * hi CursorLineNr ctermfg=243 guifg=#767676
|
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
hi VertSplit ctermfg=234 guifg=#090909 ctermbg=none guibg=#090909 term=none cterm=none
|
hi VertSplit ctermfg=234 guifg=#090909 ctermbg=none guibg=#090909 term=none cterm=none
|
||||||
|
|
115
vimrc
115
vimrc
|
@ -255,85 +255,78 @@ iabbrev tehn then
|
||||||
|
|
||||||
|
|
||||||
" #statusline format
|
" #statusline format
|
||||||
function! ActiveStatus()
|
" isactive = 0 when inactive, 1 otherwise
|
||||||
let l:statusline='%#StatusLineFile# '
|
function! GetStatus(isactive)
|
||||||
let l:statusline.='%#StatusLineMod#'
|
let l:separator='%#StatusLineSeparator#'
|
||||||
let l:statusline.='%M'
|
let l:statusline=''
|
||||||
let l:statusline.='%*'
|
|
||||||
let l:statusline.='%#StatusLineDir# '
|
" linter status
|
||||||
let l:statusline.=expand('%:p:h:t') . '/'
|
let l:statusline.='%#InterfaceH2# %{LinterStatus()} %*'
|
||||||
let l:statusline.='%#StatusLineFile#'
|
|
||||||
let l:statusline.="%{expand('%:t:r')}"
|
" file info
|
||||||
let l:statusline.='%#StatusLineDot#'
|
if a:isactive == 1
|
||||||
let l:statusline.='%#StatusLineExt#'
|
let l:statusline.='%q%h%w%r'
|
||||||
let l:extension=expand('%:e')
|
let l:statusline.=" %{strlen(&ft)?&ft:'none'},"
|
||||||
if strlen(l:extension) > 0
|
let l:statusline.='%{strlen(&fenc)?&fenc:&enc},'
|
||||||
let l:statusline.='.' . l:extension
|
let l:statusline.='%{&fileformat} '
|
||||||
|
let l:statusline.=' %{&spelllang} %*'
|
||||||
|
else
|
||||||
|
let l:statusline.=l:separator
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:statusline.=' %*'
|
" current register
|
||||||
let l:statusline.='%q%h%w%r'
|
if a:isactive
|
||||||
let l:statusline.='%#StatusLineNC# '
|
let l:statusline.=l:separator . ' %* "%{v:register}" %*'
|
||||||
let l:statusline.='%*'
|
endif
|
||||||
let l:statusline.=" %{strlen(&ft)?&ft:'none'},"
|
|
||||||
let l:statusline.='%{strlen(&fenc)?&fenc:&enc},'
|
|
||||||
let l:statusline.='%{&fileformat} '
|
|
||||||
let l:statusline.='%#StatusLineNC# '
|
|
||||||
let l:statusline.='%*'
|
|
||||||
let l:statusline.=' %{&spelllang} '
|
|
||||||
let l:statusline.='%#StatusLineNC#'
|
|
||||||
|
|
||||||
|
" session status
|
||||||
|
if a:isactive
|
||||||
|
let l:statusline.=l:separator . ' %*'
|
||||||
|
let l:statusline.=" %{ObsessionStatus(fnamemodify(v:this_session,':t'),'---')} %*"
|
||||||
|
let l:statusline.=l:separator . ' %*'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" right/left separator
|
||||||
let l:statusline.='%='
|
let l:statusline.='%='
|
||||||
|
|
||||||
let l:statusline.='%#StatusLineNC#'
|
" path/filename.extension
|
||||||
let l:statusline.=' '
|
|
||||||
let l:statusline.='%*'
|
|
||||||
let l:statusline.=' "%{v:register}" '
|
|
||||||
let l:statusline.='%#StatusLineNC#'
|
|
||||||
let l:statusline.=' '
|
|
||||||
let l:statusline.='%*'
|
|
||||||
let l:statusline.=" %{ObsessionStatus(fnamemodify(v:this_session,':t'),'---')} "
|
|
||||||
|
|
||||||
let l:statusline.='%#InterfaceH2#'
|
|
||||||
let l:statusline.=' %{LinterStatus()}'
|
|
||||||
|
|
||||||
let l:statusline.='%#InterfaceNormalDark#'
|
|
||||||
let l:statusline.=' %P '
|
|
||||||
let l:statusline.='%*'
|
|
||||||
return l:statusline
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! InactiveStatus()
|
|
||||||
let l:statusline='%#StatusLineFile# '
|
|
||||||
let l:statusline.='%#StatusLineMod#'
|
|
||||||
let l:statusline.='%M'
|
|
||||||
let l:statusline.='%*'
|
|
||||||
let l:statusline.='%#StatusLineDir# '
|
let l:statusline.='%#StatusLineDir# '
|
||||||
let l:statusline.=expand('%:p') . '/'
|
|
||||||
|
if a:isactive
|
||||||
|
let l:statusline.="%{expand('%:p:h:t')}/"
|
||||||
|
else
|
||||||
|
let l:statusline.="%{expand('%:p:h')}/"
|
||||||
|
endif
|
||||||
|
|
||||||
|
" if &l:modified
|
||||||
|
" let l:statusline.='%#StatusLineFileMod#'
|
||||||
|
" else
|
||||||
|
" let l:statusline.='%#StatusLineFile#'
|
||||||
|
" endif
|
||||||
let l:statusline.='%#StatusLineFile#'
|
let l:statusline.='%#StatusLineFile#'
|
||||||
|
|
||||||
let l:statusline.="%{expand('%:t:r')}"
|
let l:statusline.="%{expand('%:t:r')}"
|
||||||
let l:statusline.='%#StatusLineDot#'
|
let l:statusline.='%#StatusLineDot#'
|
||||||
|
|
||||||
let l:statusline.='%#StatusLineExt#'
|
let l:statusline.='%#StatusLineExt#'
|
||||||
let l:extension=expand('%:e')
|
let l:statusline.="%{strlen(expand('%:e'))?'.':''}"
|
||||||
if strlen(l:extension) > 0
|
let l:statusline.="%{strlen(expand('%:e'))?expand('%:e'):expand('%:e')}"
|
||||||
let l:statusline.='.' . l:extension
|
|
||||||
endif
|
|
||||||
let l:statusline.=' %*'
|
let l:statusline.=' %*'
|
||||||
|
|
||||||
let l:statusline.='%=%#InterfaceH2#'
|
" modified flag
|
||||||
let l:statusline.='%{LinterStatus()}'
|
let l:statusline.='%#StatusLineMod#%M' . l:separator . ' %*'
|
||||||
|
|
||||||
let l:statusline.='%#InterfaceNormalDark#'
|
|
||||||
let l:statusline.=' %P '
|
|
||||||
let l:statusline.='%*'
|
|
||||||
|
|
||||||
|
" file percentage
|
||||||
|
let l:statusline.='%#InterfaceNormalDark# %P %*'
|
||||||
return l:statusline
|
return l:statusline
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
augroup status
|
augroup status
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd WinEnter * setlocal statusline=%!ActiveStatus()
|
autocmd WinEnter * setlocal statusline=%!GetStatus(1)
|
||||||
autocmd WinLeave * setlocal statusline=%!InactiveStatus()
|
autocmd WinLeave * setlocal statusline=%!GetStatus(0)
|
||||||
|
autocmd InsertChange * setlocal statusline=%!GetStatus(1)
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue