2

I would like to setup a command to yank the whole file without moving the cursor.

Here is the macro I created:

qaggVGy

However, this moves the cursor to the beginning of the file. How can I yank the whole file without losing the cursors position ?

verdammelt
  • 914
  • 10
  • 22
edi9999
  • 18,115
  • 12
  • 85
  • 125

1 Answers1

19

I usually use :%y+ to yank the complete file into the system clipboard. You can of course use any other register as you like.

Christian Brabandt
  • 7,685
  • 26
  • 32