From ad5ab73e088fb9cca6220a7fe7894f48e24553e6 Mon Sep 17 00:00:00 2001 From: listout Date: Sat, 24 Apr 2021 10:36:00 +0530 Subject: some more subtle changes to the statusline like modes, RO flag ... --- configs/statusline.vim | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) (limited to 'configs') diff --git a/configs/statusline.vim b/configs/statusline.vim index 2b4790a..a8fb19c 100644 --- a/configs/statusline.vim +++ b/configs/statusline.vim @@ -18,9 +18,52 @@ function! StatusDiagnostic() abort return join(msgs, ' '). ' ' . get(g:, 'coc_status', '') endfunction +let g:currentmode={ + \ 'n' : 'NORMAL ', + \ 'no' : 'N·Operator Pending ', + \ 'v' : 'VISUAL ', + \ 'V' : 'V·Line ', + \ "\" : 'V·Block ', + \ 's' : 'Select ', + \ 'S' : 'S·Line ', + \ 'x19' : 'S·Block ', + \ 'i' : 'INSERT ', + \ 'R' : 'REPLACE ', + \ 'Rv' : 'V·Replace ', + \ 'c' : 'Command ', + \ 'cv' : 'Vim Ex ', + \ 'ce' : 'Ex ', + \ 'r' : 'Prompt ', + \ 'rm' : 'More ', + \ 'r?' : 'Confirm ', + \ '!' : 'Shell ', + \ 't' : 'Terminal ' + \} + +function! ReadOnly() + if &readonly || !&modifiable + return '' + else + return '' +endfunction + +"let g:currentmode={ + "\ 'n' : 'NORMAL ', + "\ 'v' : 'VISUAL ', + "\ 'V' : 'V·Line ', + "\ "\" : 'V·Block ', + "\ 'i' : 'INSERT ', + "\ 'R' : 'R ', + "\ 'Rv' : 'V·Replace ', + "\ 'c' : 'Command ', + "\} + set statusline= set statusline^=%{StatusDiagnostic()} -set statusline+=\ %f +set statusline+=\ %{toupper(g:currentmode[mode()])} +"set statusline+=\ %f +set statusline+=%8*\ %<%f\ %{ReadOnly()}\ %m\ %w +set statusline+=%{&modified?'[+]':''} set statusline+=%= set statusline+=\ %y set statusline+=\ %{&fileencoding?&fileencoding:&encoding} -- cgit v1.2.3