I have set this statusline.
:set statusline=%c
According to :help statusline
, %c
means column number.
If the buffer contents is
abcdef
éÀ│§õ→
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?
encoding=utf-8
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.
:helpgrep virtual column
is enlightening