$ command in Vim only going to the second-to-last character of a line

Viewed 238

When I use the Shift + 4 ($) command in my Vim terminal, the cursor goes to the second-to-last character of the line I'm on, not the last. Does anyone know how I could fix this? Thanks!

Image of cursor after $ command.

This image shows the cursor's location when I use the $ command on line 5.

1 Answers

Likely it actually is on the last character. If you press "a", does it bring you to after? Does "i" bring you to before? If so, that's because it's actually ON the character, not before nor after. Vim just doesn't show that with the block cursor there.

You could always enter insert mode with "a" to avoid this problem, or if you prefer "i" or another key, you could rebind them to "a".

Just to illustrate what I mean, here is what it looks like in normal mode with a block cursor. As you can see, it's ON the character, not before nor after.

enter image description here

Related