We can inspect registers with:
In insert mode, we can paste the content of a register, simply by issuing:
Things we yank are automatically placed in the
0 register, so this is
not overwritten by delete commands like
Anyway let's see how to select registers and work with them.
"<letter> selects a register denoted with
a, we can do this
and we can paste the content from this register by doing:
We can append content to register
a by woking on register
we could add another word in the content of
a by doing:
and pasting the content of
Always remember that uppercase registers are used to append content to lowercase registers.
If vim is compiled with clipboard extension option we can work with graphical
clipboards, specifically with registers
+ (the one we commonly work with
copy/paste or ctrl-c, ctrl-v) and
* (we can paste content from
* by using
the middle mouse button).
We can append to other registers, e.g., the clipboard register with let:
You have to use :let @+ .= your_expression
TO REORGANIZE THE FOLLOWING PARAGRAPH see stackoverflow. The problem, as you have understood, is that you cannot capitalise the + character.
For example, to add a line in your buffer to the clipboard, place the cursor on the line and yank it with yy. Then type :let @+ .= @0 to run (:) the command let to append (.=) register (@) 0, which always holds the last yank, to register + which is a representation of the clipboard.
For example, to add the string "abc" to the clipboard, type :let @+ .= 'abc'.
(To change the X11 selection instead of the clipboard register + use register
vim has a huge set of commands. If you plan to adopt it as your favourite editor it is worth putting some effort into knowing, at least superficially, some of them. Most vim users probably only use about a dozen commands and are not interested it its true potential. It's a pity, as such tools could significantly reduce their workload.