Vim - how to start pasting at the end of a file in one step

Is there one shortcut to start pasting in a new line at the end of the file?

I know G + o combos.

+41
vim
Nov 06 '08 at 9:53
source share
5 answers

There is also a + command line option:

 vim + myfile.txt

Open the myfile.txt file and make automatic G for you.

+42
Dec 18 '08 at 19:53
source share
— -

Adding the following to ~ / .vimrc will create it for you:

:nmap ^A Go 

To enter "^ A", first press Ctrl-V, then press Ctrl-A. Then you can use Ctrl-A to add at the end of the file if it is not in insert or render mode.

+11
Nov 06 '08 at 9:59
source share

Not that I know - G + o is what I would suggest, but these are two steps :)

You can always create a macro that does G + o , and then you can call a macro that will be 1 step.

+10
Nov 06 '08 at 9:56
source share

You can embed the map definition in your .vimrc and then call it when you open the file.

Or, if you want to do this only for a specific file, you can create autocmd for this type of file that does this automatically. See autocommand in vim docs.

+1
Nov 06 '08 at 10:01
source share
 echo >> myfile.txt && vim -c 'startinsert' + myfile.txt 

You can also save the above command in a script and then use $ 1 instead of myfile.txt, name your script myvim (or whatever) and always open your files and start writing right away.

 myvim myfile.txt 
+1
Nov 29 '14 at 21:40
source share



All Articles