After freshly installing vim on a new operating system I noticed that the status bar shows the dimensions of the current selection (2x20).

enter image description here

I have never seen this before and thought it would be a good addition to my personal vimrc. However, after looking in /etc/vim/vimrc I can't find the option that enables this. Is it something non-obvious or perhaps a compile time option?


This is not a status line. This is :set showcmd which is shown below the status line on the right of the screen.

If you really want to put such indicator to the status line, it's surely possible but could also require some skill of building custom status lines. Roughly speaking, you need to build a (sub-)expression which checks if the current mode is "Visual" and calculates the (absolute) difference between getpos('v') and getpos('.'). There is no some "magic" option to save you from tedious work.

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.