better status line
This commit is contained in:
parent
2750204014
commit
6b6f648eba
|
@ -200,8 +200,8 @@ hi StatusLine ctermfg=232 guifg=#000000 ctermbg=232 guibg=NONE gui=NON
|
|||
hi StatusLineNC ctermfg=238 guifg=#444444 ctermbg=232 guibg=NONE term=none cterm=none gui=NONE
|
||||
|
||||
hi StatusLineNormal ctermfg=243 guifg=#777777 ctermbg=234 guibg=#1c1c1c term=none cterm=none
|
||||
hi StatusLineInput ctermfg=255 guifg=#ffffff ctermbg=239 guibg=#4e4e4e term=none cterm=none
|
||||
hi StatusLineInputLeave ctermfg=243 guifg=#777777 ctermbg=234 guibg=#1c1c1c term=none cterm=none
|
||||
hi StatusLineActive ctermfg=255 guifg=#ffffff ctermbg=239 guibg=#4e4e4e term=none cterm=none
|
||||
hi StatusLineActiveQuotes ctermfg=244 guifg=#888888 ctermbg=239 guibg=#4e4e4e term=none cterm=none
|
||||
hi StatusLineDivider ctermfg=234 guifg=#1a1a1a ctermbg=234 guibg=#1a1a1a term=none cterm=none
|
||||
hi StatusLineSeparator ctermfg=232 guifg=#ffffff ctermbg=232 guibg=NONE
|
||||
hi StatusLineDir ctermfg=241 guifg=#666666 ctermbg=234 guibg=#1c1c1c
|
||||
|
@ -212,14 +212,12 @@ hi StatusLineExt ctermfg=243 guifg=#777777 ctermbg=234 guibg=#1c1c1c
|
|||
hi StatusLineMod ctermfg=255 guifg=#ffffff ctermbg=88 guibg=#490000
|
||||
|
||||
function! DoInsertEnter()
|
||||
hi! def link StatusLineNormal StatusLineInput
|
||||
set cursorline
|
||||
hi LineNr ctermfg=235 guifg=#262626
|
||||
hi CursorLineNr ctermfg=250 guifg=#bcbcbc
|
||||
endfunction
|
||||
|
||||
function! DoInsertLeave()
|
||||
hi! def link StatusLineNormal StatusLineInputLeave
|
||||
set nocursorline
|
||||
hi LineNr ctermfg=237 guifg=#3a3a3a
|
||||
hi CursorLineNr ctermfg=243 guifg=#767676
|
||||
|
|
60
vimrc
60
vimrc
|
@ -252,46 +252,48 @@ iabbrev tehn then
|
|||
" #statusline format{{{
|
||||
" isactive = 0 when inactive, 1 otherwise
|
||||
|
||||
|
||||
|
||||
" get status line{{{
|
||||
function! GetStatus(isactive)
|
||||
let l:separator='%#StatusLineSeparator#'
|
||||
let l:separator='%#StatusLineSeparator# '
|
||||
let l:normal='%#StatusLineNormal#'
|
||||
let l:active='%#StatusLineActive#'
|
||||
let l:statusline=''
|
||||
"}}}
|
||||
|
||||
" linter status
|
||||
" linter status{{{
|
||||
let l:statusline.='%#InterfaceH2# %{LinterStatus()} %*'
|
||||
|
||||
" file info
|
||||
"}}}
|
||||
" file info{{{
|
||||
if a:isactive == 1
|
||||
let l:statusline.=l:active
|
||||
let l:statusline.='%q%h%w%r'
|
||||
let l:statusline.=" %{strlen(&ft)?&ft:'none'},"
|
||||
let l:statusline.='%{strlen(&fenc)?&fenc:&enc},'
|
||||
let l:statusline.='%{&fileformat} '
|
||||
let l:statusline.=l:separator . ' %* %{&spelllang} %*'
|
||||
let l:statusline.=l:separator . l:active
|
||||
let l:statusline.=' %{&spelllang} '
|
||||
else
|
||||
let l:statusline.=l:separator
|
||||
endif
|
||||
|
||||
" current register
|
||||
"}}}
|
||||
" current register{{{
|
||||
if a:isactive
|
||||
let l:statusline.=l:separator . ' %* "%{v:register}" %*'
|
||||
let l:statusline.=l:separator . l:active
|
||||
let l:statusline.=' %#StatusLineActiveQuotes#"' . l:active . '%{v:register}%#StatusLineActiveQuotes#" '
|
||||
endif
|
||||
|
||||
" session status
|
||||
"}}}
|
||||
" session status{{{
|
||||
if a:isactive
|
||||
let l:statusline.=l:separator . ' %*'
|
||||
let l:statusline.=l:separator . l:active
|
||||
let l:statusline.=" %{ObsessionStatus(fnamemodify(v:this_session,':t'),'---')} %*"
|
||||
let l:statusline.=l:separator . ' %*'
|
||||
let l:statusline.=l:separator . l:active
|
||||
else
|
||||
let l:statusline.='%#StatusLineDivider# %< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >%* '
|
||||
let l:statusline.='%#StatusLineDivider# %< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >' . l:separator . '%*'
|
||||
endif
|
||||
|
||||
" right/left separator
|
||||
let l:statusline.='%='
|
||||
|
||||
" path/filename.extension
|
||||
"}}}
|
||||
" right/left separator{{{
|
||||
let l:statusline.='%#StatusLineNC#%='
|
||||
"}}}
|
||||
" path/filename.extension{{{
|
||||
let l:statusline.='%#StatusLineDir# '
|
||||
|
||||
if a:isactive
|
||||
|
@ -309,23 +311,23 @@ function! GetStatus(isactive)
|
|||
let l:statusline.="%{strlen(expand('%:e'))?'.':''}"
|
||||
let l:statusline.="%{strlen(expand('%:e'))?expand('%:e'):expand('%:e')}"
|
||||
let l:statusline.=' %*'
|
||||
|
||||
" modified flag
|
||||
"}}}
|
||||
" modified flag {{{
|
||||
let l:statusline.='%#StatusLineMod#%M' . l:separator . ' %*'
|
||||
|
||||
" file percentage
|
||||
"}}}
|
||||
" file percentage{{{
|
||||
let l:statusline.='%#InterfaceNormalDark# %P %*'
|
||||
return l:statusline
|
||||
endfunction
|
||||
|
||||
" status line autocommands
|
||||
"}}}
|
||||
" status line autocommands{{{
|
||||
augroup status
|
||||
autocmd!
|
||||
autocmd WinEnter * setlocal statusline=%!GetStatus(1)
|
||||
autocmd WinLeave * setlocal statusline=%!GetStatus(0)
|
||||
autocmd InsertChange * setlocal statusline=%!GetStatus(1)
|
||||
" autocmd InsertChange * setlocal statusline=%!GetStatus(1)
|
||||
augroup END
|
||||
"}}}
|
||||
"}}}}}}
|
||||
|
||||
" #autocommands{{{
|
||||
|
||||
|
|
Loading…
Reference in New Issue