feat: make nvim statusline more readable in particular cases

change 'nofiletype' string
column now always display 3 digits
change filename shortening threshold (window width: 70 -> 90)
mode is now 3 letters
This commit is contained in:
swytch 2020-05-24 00:32:09 +02:00
parent 4e7b868e23
commit 196eaa667f
1 changed files with 13 additions and 13 deletions

View File

@ -1,13 +1,13 @@
function! CurrentMode() function! CurrentMode()
let g:currentmode={ let g:currentmode={
\ 'n' : '[ NORMAL ]', \ 'n' : '[ NRM ]',
\ 'v' : '[ VISUAL ]', \ 'v' : '[ VIS ]',
\ 'V' : '[ V·LINE ]', \ 'V' : '[ V·L ]',
\ '' : '[ V·BLOCK ]', \ '' : '[ V·B ]',
\ 'i' : '[ INSERT ]', \ 'i' : '[ INS ]',
\ 'R' : '[ REPLACE ]', \ 'R' : '[ RPL ]',
\ 'Rv' : '[ V·REPLACE ]', \ 'Rv' : '[ V·R ]',
\ 'c' : '[ COMMAND ]', \ 'c' : '[ CMD ]',
\} \}
return g:currentmode[mode()] return g:currentmode[mode()]
@ -30,7 +30,7 @@ endfunction
function! FileName() function! FileName()
let g:name=' ' let g:name=' '
if winwidth(0)>70 if winwidth(0)>90
let g:name.='%F' let g:name.='%F'
else else
let g:name.='%t' let g:name.='%t'
@ -69,11 +69,11 @@ function! StatusLine()
" Filetype " Filetype
let l:statusline.='%#FileType#' let l:statusline.='%#FileType#'
let l:statusline.="%{&filetype!=#''?&filetype.' ':'none '}%*" let l:statusline.="%{&filetype!=#''?&filetype.' ':'no ft '}%*"
" Encoding & Fileformat " Encoding & Fileformat
let l:statusline.='%#WarningMsg#' "let l:statusline.='%#WarningMsg#'
let l:statusline.="%{&fileencoding!='utf-8'?'['.&fileencoding.'] ':''}%*" "let l:statusline.="%{&fileencoding!='utf-8'?'['.&fileencoding.'] ':''}%*"
" Depth " Depth
let l:statusline.='%#Percent#' let l:statusline.='%#Percent#'
@ -81,7 +81,7 @@ function! StatusLine()
" Location of cursor in line " Location of cursor in line
let l:statusline.='%#Column#' let l:statusline.='%#Column#'
let l:statusline.='-%c-' let l:statusline.='-%03.c-'
return l:statusline return l:statusline
endfunction endfunction