Reputation: 1572
I've build my own statusline in VIM with, to show the current mode indicator I use:
set statusline+=%#NormalColor#%{(mode()=='n')?'\ \ NORMAL\ ':''}
set statusline+=%#InsertColor#%{(mode()==?'i')?'\ \ INSERT\ ':''}
set statusline+=%#ReplaceColor#%{(mode()==?'R')?'\ \ RPLACE\ ':''}
set statusline+=%#VisualColor#%{(mode()==#'v')?'\ \ VISUAL\ ':''}
set statusline+=%#VisualColor#%{(mode()==#'V')?'\ \ V-LINE\ ':''}
set statusline+=%#VisualColor#%{(mode()=='\<C-V>')?'\ \ V-BLOCK\ ':''}
It works for all the modes except for the V-BLOCK. Is there a way to match the '\< C-V>' with such approach?
Upvotes: 0
Views: 93
Reputation: 195039
This line should help you. The ^V
has ascii value 22:
.....%{(mode()==nr2char(22))?'\ \ V-BLOCK\ ':''}
Upvotes: 1