tags:

views:

453

answers:

4

Is there a single shortcut to start inserting in the new line at end of the file? I'm aware of G + o combo.

+2  A: 

Not that I know of - G + o is what I would have suggested too, but that is 2 steps :)

You could always create a macro which does G + o, and then you can invoke the macro which will be 1 step.

LeopardSkinPillBoxHat
+7  A: 

Adding the following into ~/.vimrc will create one for you:

:nmap ^A Go

To type the "^A" first press Ctrl-V, then press Ctrl-A. You can then use Ctrl-A to append at the end of the file when not in insert or visual mode.

Ignacio Vazquez-Abrams
Note that this overrides the default behavior of ^A, which is to increment the number or character under the cursor intelligently.
Zathrus
+1  A: 

You could stick the map definition in your .vimrc and then invoke it when the you open the file.

Or, if you only want to do this for a particular file, you could create an autocmd for that file type that does it automatically. See autocommand in the vim doc's.

HTH

cheers,

Rob

Rob Wells
+1  A: 

There's also the command line option "+":

vim + myfile.txt

Will open myfile.txt and do an automatic G for you.

Leonardo Constantino