Inserting at the end of a line in VIM

Vim

Vim Problem Overview


So for a long time I've had a bad habit of going to the end of a line, hitting the i key and then hitting the right arrow to insert after that last character. However, this is extremely inefficient and impossible to do with hjkl.

What's a better way to insert at the VERY end of the line?

Vim Solutions


Solution 1 - Vim

Use A command instead of i. The command appends text at the end of the line. See :help A.


In normal mode press A (uppercase). Vim will be switched to insert mode, and the cursor will be moved to the end of the current line ready for input.

Solution 2 - Vim

The $ positions you at the end of line.

Then, to enter insert mode AFTER the end of line, press a.

So, simply typing $a while in command mode will do what you are asking.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGenTelView Question on Stackoverflow
Solution 1 - VimRuslan OsmanovView Answer on Stackoverflow
Solution 2 - VimChuckBView Answer on Stackoverflow