1

I have this in my vimrc for setting the status line:

set laststatus=2
set statusline=%3(%{mode()}\ %)
set statusline+=%1*\ %F

For normal and visual mode (but also for all other modes tested):

Normal Visual Line

But for visual block and select block mode, the display is broken: the trailing space is not displayed with the same color:

Visual Block

What is the issue here?

  • 1
    mode() returns a literal Ctrl-V for visual block mode and a literal Ctrl-S for select mode. You should write a custom function that cleans up the output of mode() instead of mode() directly. – romainl May 24 '16 at 5:19
  • This seems to solve the issue, if you want to make an answer, I'll accept it. – nobe4 May 24 '16 at 6:34
2

mode() returns a literal Ctrl-V for visual block mode and a literal Ctrl-S for select mode.

You should write a custom wrapper around mode() to avoid side effects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.