I use vim (Actually gvim on windows) as my main text editor. In my work flow I have to copy sentences to/from various external sources, therefore I use clipboard=unnamed to save me key strokes (p instead of "*p).
I copy text from an outer source and I want to paste it over two different places in vim. I mark the first one (v) and then use p to paste over it. The problem is that at this point I lose the original buffer and can't paste it in the second place. It does not exist in the unnamed buffer, the * buffer or the numbered buffers. My guess is that pasting over selection is putting the "pasted over" text in the unnamed buffer.
How can I paste my original string in two locations? i.e. prevent it from getting lost from the buffers.
Thanks.
Copying and pasting text From the source document or webpage, copy the text to your clipboard. You can copy and paste text using Ctrl+C/Ctrl+V in Windows and Cmd+C/Cmd+V in Mac OS X. You can also use the right-click context menu.
Simply highlight the text you want to want to copy from the internet and type Ctrl+C to copy it into your clipboard. Then use the Ctrl+V command to paste the text into a cell of your choosing in your Excel spreadsheet. The pasted text will retain the formatting from the website.
Reviewing or editing in browserPress Ctrl+C to copy, Ctrl+X to cut, or Ctrl+V to paste the text or picture (Windows); or press ⌘+C, ⌘+X, or ⌘+V (Mac). On Chrome, Firefox, and Chromium-based Edge, you can also use Ctrl+Shift+V and ⌘+Shift+V to paste text only (pastes text without source formatting).
Use Ctrl + C to copy something, then Ctrl + V to paste. If you want to cut instead of copying, use Ctrl + X. To paste the copied text, use the arrow keys or mouse to put the cursor where you want to insert the copied item and press Ctrl + V.
Try this:
:vmap p "_xP
vmap
means to make a mapping that only applies in visual mode.p
is the key to create the mapping for."_
is the black hole register. This is used in any situation where you want to delete text without affecting any registers.xP
means delete the selected text, then paste before the resulting cursor position.You could set up a mapping to ease your pain:
:vmap <F5> "zxP
This will delete the visually selected text, but put it in a different register, so the clipboard isn't affected. Change <F5>
to whatever is easiest for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With