In visual mode, the message display seems fixed:

  • VISUAL: it contains either the number of characters selected or the number of lines;
  • VISUAL LINE: contains the number of lines;
  • VISUAL BLOCK: contains the dimensions of the selected area (rows × columns).

Can this be customized and how?

My goal is to run analysis functions on the selected text targeting mainly VISUAL mode: counting characters, line widths etc. Of course, one could filter the selection by running a function on it but I’d like the information to be updated live and conveniently located in the message line.

EDIT: The code that handles the behavior in question doesn’t appear to be configurable.

  • no it can't. If you want this, then you can try to do this using the statusline option Oct 17, 2016 at 13:25

1 Answer 1


Yes this is possible. The starting point is :h 'statusline'. However, I must point you towards vim-airline and powerline plugins. They already do many related things. If not what you're looking for, their (complicated) code should give you hints regarding what you what to achieve.

  • The statusline help doesn’t mention visual modes nor does status-line. I already have a highly customized statusline which nevertheless is only visible in normal and insert mode.
    – phg
    Oct 17, 2016 at 9:17
  • No, but it should point you to % syntax. From here, call a function. In that function, test the current mode and if you're in visual mode, then you can start counting what you find in getline("'[", "']"). Oct 17, 2016 at 9:26
  • Sorry I just realized I was actually referring to the message line which doesn’t even have help item.
    – phg
    Oct 17, 2016 at 9:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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