I have set this statusline.

:set statusline=%c

According to :help statusline, %c means column number. If the buffer contents is


and the cursor is on the f character, the statusline correctly reports "6". But if on the arrow character, it reports "12" instead of "6", certainly because it is counting bytes instead of characters (éÀ§õ→ are 2 bytes each and is 3 bytes).

The file encoding is correct:

:set encoding?

Is it possible to workaround that and have the column count instead of the byte count? I have thought of using the %{ } construct with the Unix wc -m command to count characters, but I cannot devise a plan to put all the pieces together, if it is possible at all.

PS: The 5| normal mode command correctly moves to the 5th column on both lines.


1 Answer 1


Well, it looks the answer is as simple as

:set statusline=%v

That uses the virtual column number instead of the column number.

Thanks to D. Ben Knoble for pointing me in the right direction.

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.