vim

Move cursor to end of file in vim


When I want the cursor to go to the end of the file (i.e. the end of the last line) in Vim, I have to type six keystrokes:

<ESC>G$a - which translates to ESC + Shiftg + Shift4 + a on my keyboard layout.

How can I do this more efficiently?

Since I regularly work on many different machines, I cannot always change .vimrc, so I'm looking for answers without having to edit or create that file.


Solution

  • No need to explicitly go to the end of line before doing a, use A;
    Append text at the end of line [count] times

    <ESC>GA