A very common use case I'm having is to copy something (let's say a word) and I want to paste it in another context (let's say a word with quotes). The way I do it is:
const char *foobar(void) {
return "barfoo";
}
there, as my cursor is on foobar:
const char *foo|bar(void) {
I could do something like:
yiw
to copy content. Then:
j
to move within the returned string:
return "bar|foo";
And then I should do:
vi"p
to paste foobar
within the quotes:
return "foobar|";
My question is whether there's a way to use a motion to put
, the same way it is possible to yank
, what I'd love to do is something like:
pi"
which obviously wouldn't work. I find it feels weird to have to use a visual to apply a paste within a motion, but everybody I asked told me it's not possible. If it is indeed not, what would be the rationale of having the action put
not accepting a motion‽