better status line

This commit is contained in:
ManjaroOne666 2018-03-06 13:59:45 +00:00
parent d4bc6393d3
commit f6a748d67b
2 changed files with 79 additions and 76 deletions

View File

@ -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 TabModifiedSelected ctermfg=255 guifg=#eeeeee ctermbg=234 guibg=#1c1c1c
hi StatusLine ctermfg=255 guifg=#eeeeee ctermbg=240 guibg=#444444 term=none cterm=none
hi StatusLineNC ctermfg=238 guifg=#444444 ctermbg=233 guibg=#121212 term=none cterm=none
hi StatusLineNormal ctermfg=243 guifg=#777777 ctermbg=234 guibg=#1c1c1c 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 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 StatusLineExt ctermfg=243 guifg=#777777 ctermbg=234 guibg=#1c1c1c
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
augroup statuscursorlines
au InsertEnter * hi StatusLine ctermfg=233 guifg=#121212 ctermbg=255 guibg=#eeeeee
au InsertLeave * hi StatusLine ctermfg=255 guifg=#eeeeee ctermbg=239 guibg=#4e4e4e
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
au!
au InsertEnter * call DoInsertEnter()
au InsertLeave * call DoInsertLeave()
augroup END
hi VertSplit ctermfg=234 guifg=#090909 ctermbg=none guibg=#090909 term=none cterm=none

109
vimrc
View File

@ -255,85 +255,78 @@ iabbrev tehn then
" #statusline format
function! ActiveStatus()
let l:statusline='%#StatusLineFile# '
let l:statusline.='%#StatusLineMod#'
let l:statusline.='%M'
let l:statusline.='%*'
let l:statusline.='%#StatusLineDir# '
let l:statusline.=expand('%:p:h:t') . '/'
let l:statusline.='%#StatusLineFile#'
let l:statusline.="%{expand('%:t:r')}"
let l:statusline.='%#StatusLineDot#'
let l:statusline.='%#StatusLineExt#'
let l:extension=expand('%:e')
if strlen(l:extension) > 0
let l:statusline.='.' . l:extension
endif
" isactive = 0 when inactive, 1 otherwise
function! GetStatus(isactive)
let l:separator='%#StatusLineSeparator#'
let l:statusline=''
let l:statusline.=' %*'
" linter status
let l:statusline.='%#InterfaceH2# %{LinterStatus()} %*'
" file info
if a:isactive == 1
let l:statusline.='%q%h%w%r'
let l:statusline.='%#StatusLineNC# '
let l:statusline.='%*'
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#'
let l:statusline.=' %{&spelllang} %*'
else
let l:statusline.=l:separator
endif
" current register
if a:isactive
let l:statusline.=l:separator . ' %* "%{v:register}" %*'
endif
" 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.='%#StatusLineNC#'
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.='%*'
" path/filename.extension
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.="%{expand('%:t:r')}"
let l:statusline.='%#StatusLineDot#'
let l:statusline.='%#StatusLineExt#'
let l:extension=expand('%:e')
if strlen(l:extension) > 0
let l:statusline.='.' . l:extension
endif
let l:statusline.="%{strlen(expand('%:e'))?'.':''}"
let l:statusline.="%{strlen(expand('%:e'))?expand('%:e'):expand('%:e')}"
let l:statusline.=' %*'
let l:statusline.='%=%#InterfaceH2#'
let l:statusline.='%{LinterStatus()}'
let l:statusline.='%#InterfaceNormalDark#'
let l:statusline.=' %P '
let l:statusline.='%*'
" modified flag
let l:statusline.='%#StatusLineMod#%M' . l:separator . ' %*'
" file percentage
let l:statusline.='%#InterfaceNormalDark# %P %*'
return l:statusline
endfunction
augroup status
autocmd!
autocmd WinEnter * setlocal statusline=%!ActiveStatus()
autocmd WinLeave * setlocal statusline=%!InactiveStatus()
autocmd WinEnter * setlocal statusline=%!GetStatus(1)
autocmd WinLeave * setlocal statusline=%!GetStatus(0)
autocmd InsertChange * setlocal statusline=%!GetStatus(1)
augroup END