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 1:
This is quicker. Just use this
:$
Solution 2:
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
Solution 3:
Hit Esc and then press: Shift + G
Solution 4:
For starters, there's no need for the return. G$
will do. And you're being misleading by counting <Esc>
and a
in the length of a normal mode command.
However, you can use Ctrl + End if you like.