Imagine you create a bunch of recorded keyboard macros that store stuff in different registers. Now this change comes and instead of typing `"ay` you have to press `"a<Enter>y`. Indeed any time you store to a register (`"a`) you have to add an enter key. This breaks all of your keyboard macros and all of your muscle memory made over the past twenty years or more.
Ive used vim for 10+ years, and I have known about yanking to different registers, but usually I only use the main register 99.9999% of the time. can you explain your use cases for using multiple registers? I should start doing this perhaps, but I can't think of many times I want to copy more than one thing at once, maybe once a month? But I also could be not thinking of the right examples.
"ayy - copy function signature
"byy - copy return signature
"ap "bp - paste either...
:reg - show all registers
"3p - paste 3rd "historical" register
"_dd - delete into the /dev/null buffer (so you don't eat your `yy` register that you'd already yanked)
It's admittedly a bit of an advanced/esoteric feature, but being able to paste "this part" or "that part" being somewhat context dependent is useful.
Also useful in the context of macros... A, B, C being differing bits you might be "lifting", and then placing somewhere.
i<c-r>" / i<c-r>a - recall (while in insert mode) the default, or the named register.
Imagine that your converting `function do_something() { ... }` to: `arr["do_something"] = function() { ... }`
You could delete the function name into "A", the function body into "B", then go back to your marked spot, and pull out the "A" into the hash key, and put "B" as the key value.
It's reeeally awkward and complicated until you use it and it becomes a natural part of your way of thinking. Then it becomes "simply" two extra characters to type when working with _any_ copy/paste task and then you have a super-power of 26 choices of holding things off to the side.
`<c-r>$REG` is honestly one of the best "beginner" uses of registers. It lets you "inline type" what you've just lifted/cut. eg:
vwy - yank visible word into default register
V"ay - yank whole line into register "a"
I<c-r>"=<c-r>"+1 => `word = word + 1` (without having to exit insert mode!)
"ap - paste the line from register "a"
...it's a small thing, but an important aspect of "vim as a live text-based programming language", having a few "hot" named variables / text strings, and being able to see them and manipulate them. It's literally just the double-quote key and ":reg" that gives you access to it.
Ah this is incredible, thank you. I didnt realize that about <c-r>... wow, that is crazy cool.
Next question, do you usually add stuff to buffers in alphabetical order... a,b,c or do you pick something easier within reach like a,s,d (or something else entirely)
Usually a/b/c but sometimes f/function, k/key, v/value... just a simple mnemonic.
To really blow your mind:
i<c-r>%
V:!ls<cr>
Then you start playing with marks a little bit with a similar concept (eg: ma, mb, mc, 'a, 'b, 'c), and the good friend `gi` (go back to previous insert position)...
It's again, esoteric, but as you use it more, it becomes less esoteric and more just another part of your vim vocabulary (:help search-offset, fellow traveler).
Usually I yank into like p or something when I want to not just paste later, but delete something and then paste. I hate it when I delete something to make room for what I paste and it gets rid of it. Then I fumble with the numbered registers and mess it up.
Or when I select something and then paste and I actually wanted to keep my paste buffer and not replace it
First thing I thought about: yank a line to a, yank another line to b; move somewhere into the file; paste from a, move two lines down, paste from b; repeat N times or create a macro for it. Basically it will be macro with two inputs, the contents of the a and b registers.
Imagine you create a bunch of recorded keyboard macros that store stuff in different registers. Now this change comes and instead of typing `"ay` you have to press `"a<Enter>y`. Indeed any time you store to a register (`"a`) you have to add an enter key. This breaks all of your keyboard macros and all of your muscle memory made over the past twenty years or more.
This is why people are upset.