Why does Vim position the caret one character off with $ (end of line)?

Pressing $ while in command mode causes the cursor to move to the end of the line, effectively highlighting the last character. Hit i here to insert before the last character, or a to append to the line. It is slightly ambiguous here, because you're using a pipe character as a cursor rather than a rectangular block cursor. Have a look at ":help termcap-cursor-shape" if you want to change that.

If the goal is to append to the end of the line, A will jump to the end of the line and enter insert mode with a single keypress.


Use a to append a character after the current.

Or, to go to the end of the line and append in 1 step, use capital A. I.e. shiftA.

Similarly shift-I to insert at the beginning of the line without first having to press ^.

Tags:

Vim