Possible Duplicate:
vim: copy selection to OS X clipboard
While I succeeded to map paste
from clipboard (nmap <leader>p "*p
), the same for yank
(nmap <leader>y "*y
) doesn't seem working. Actually, it yanks in Vim's clipboard.
Any idea how to do it properly? I know of clipboard=unnamed
but I might keep the old yank/paste vim's commands.
EDIT: It seems there is some confusion about my needs.
The command "*y
works. So there is nothing wrong with the +clipboard
thing in my Vim env. What does not work is the mapping stuff.
I want to add stuff like:
nmap <leader>y "*y # Doesn't work as expected. It copies only in Vim's clipboard, ie I have to type `p` to paste the copied content instead of `"*p`.
nmap <leader>p "*p # Works as expected.
Am I clearer?
2nd EDIT: Just in case, 'cause I have no idea what could help you helping me, there is the render of vim --version
in my machine: https://gist.github.com/3090385
We can use the “+p and <Ctrl+r>+ in normal and command mode, respectively. However, it might be more convenient if we use the <Ctrl+Shift+v> hotkey since it does the same thing as “+p. Similarly, <Ctrl+Shift+c> will yank the text into the + register to be available for pasting outside of Vim.
Copying in Vim Copying text in Vim is also referred to as yanking. Use the y key on the keyboard when performing this operation. There are a number of yank commands, mainly differing on the amount of text you want to copy. Once in normal mode, move the cursor to the needed place and use the appropriate command.
If you're visually selecting before yanking then you need vmap
not nmap
. Otherwise, yank is a normal command and is expecting a motion command.
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