This is more of a specific deeper dive into vanilla Vim then the question Can I make Vim also save “small deletions” into register "1?.
A common text editing situation I run into is to yank a text string and then attempt to replace another string with the one previously yanked.
If I do this on a line Vim generously rotates the registries for me ("1
, "2
, "…
) but with inner text movement you usually get one register and it gets swallowed with the last movement.
So the following example becomes problematic:
foobar = "this is a test"
bazfoo = "this is another test"
^- Cursor
yi"kci"<C-R>-
. Now I could preempt this with "ayi"kci"<C-R>a
. However, this is slightly problematic because more times than not the later is executed like this instead: yi"kci"crap!<Esc>uj"ayi"kci"<C-R>a
.
Obviously this isn't ideal. So I am curious, how do I conveniently manage small change registers or is there a better way to replace a text object with a previously yanked one?
"0p
or<C-r>0
use the last yank so you can cut whatever you want in the mean time and keep the ability to put the last yank.