Assume I've copied some text into the clipboard from another program. I'm on MacOS, so in Vim terms, this means the text is in the +
and *
registers (I have verified this using :registers
). I use clipboard=unnamed
because it makes it easier to copy text out of Vim. However, let's say I have this buffer:
someFunctionCall(blah, more blah, other blah)
^---- cursor position
Let's say I want to change all the text inside the parentheses to the contents of the clipboard (perhaps new blah, more new blah
). I can type ci(
, but this immediately puts blah, more blah, other blah
into the clipboard instead, wiping out what's already in the clipboard.
Is there an elegant, or reasonably elegant, way to do this? I'd ideally like to do this without using plugins.
vibp
. More opinionated: don’t sync the clipboard and the unnamed register :)"*y
isn’t too hard to type, and I have it bound as an operator on C-y; plus there’s also:[range]yank *
.clipboard=unnamed
in certain environments (e.g. Windows). Major convenience, IMO. What's the downside you have in mind?clipboard
statement, but clearly that's just personal preference at the end of the day. If you turn this into an answer, I'll accept it.