:reg " and :reg 0
When you use x, you are cutting to the default register.
# To see what in the default register
:reg "
# To see what in the register 0
:reg 0 # yank register
Using reg 0 to paste
# diw(delete inner word) will register in the default register.
# In order to put the yanked word, use `"0P`.
"0P
True delete in vim
# Just to delete, use "_.
# e.g. to delete a word
"_diw
Replace a word with yanked text
Within a file
# copy to register a
# <C-V> to change to visual mode and select line(s) or word(s)
"ay # use a-z
# to paste it
"ap
# check it in register
:reg "a:
# Delete it in the register a
qaq
# check it again
:reg "a # should be nothing in register a
# help
:h quote_alpha
# You can append to a register
"Ayy # to append to a line
# or use
:yank A
# or append all lines which has def
:global/def/yank A
To copy from one file to another
# <C-v> to change to visual mode and select lines
# to copy
"+y
# to paste
"+p