dd puts the text I want to yank, in some register.
Before a yank, a couple more
dd's, now the first
dd register has changed.
How do I yank so that it's the first
dd I want. I can't keep track of registers in between.
Allow me to rephrase your question. This is to make sure that I understand it fully:
ddto cut some text that you want to paste at a later point in time.
You see another line that you wish to remove, and press
ddto remove it. You may need to do this for multiple lines.
Now, you wish to use
pto paste the text content in step 1.
However, the content in step 2 is pasted.
The solution is to use registers. These are triggered with the
" key. (If it is difficult to press, we can use a mapping.)
The problem is that
dd actually does a "cut", instead of "removing" text. That is, in step 2,
dd actually stores the text, instead of removing it.
We can resolve this is two ways, choose one or the other:
First, in step 2, use
"_ddto actually remove the text (cut to null register, or cut to nowhere). This method is preferred if there are few lines to remove.
Otherwise, in step 1, save the text to some register (e.g.,
"rdd) and paste that register in step 3
"rp). This method is preferred if there are many lines to remove in step 2.
We have to make a change either in step 1, or in step 2. This is because we cannot use the same mapping
dd to both "cut" and "remove" text.
" is too hard to press, we can use a mapping. For example, we can use
nnoremap - "
to replace the
" key with
-. Then, using the second solution, we can do