Copying from external clipboard in gvim

Sunday, February 28, 2010

Normally, to copy from inside vim 'yy' and 'p' works. But if you are copying from an external application (say web browser or some other editor) it will not work. The easiest way is to do Edit->Paste.

But, to make life easier, we can remap it. Put this in ~/.vimrc
map "+gP

Further, to copy from vim to external clipboard, add this too:
map "+y

Now Ctrl+c and Ctrl+v works for copy paste in vim.

0 comments: