Tutorial by Examples

In Normal, type the following to delete a range of lines into a named register :10,20d a This will delete lines 10,20 in register "a. We can verify this by typing :reg This will show the text that was delete in register "a. To paste the contents in "a, just type "ap ...
In Insert mode, press <C-r> and then % to insert the filename. This technique is applicable to all registers. For e.g. if in insert mode, you want to paste the current search pattern, you can type <C-r> and then /.
Use the quotestar register to copy/paste between Vim and system clipboard "*yy copies the current line into the system clipboard "*p pastes the content of the system clipboard into Vim
Yank all lines containing TODO into a register by using append operation :global/TODO/yank A Here, we are searching for a TODO keyword globally, yanking all lines into register a (A register appends all lines to a register). NOTE: It is in general a good practice to clear a register before perf...

Page 1 of 1