Quantcast
Channel: How can I make Vim paste from (and copy to) the system's clipboard? - Stack Overflow
Viewing all articles
Browse latest Browse all 39

Answer by chao for How can I make Vim paste from (and copy to) the system's clipboard?

$
0
0

The simplest solution to this, that also works between different Linux machines through ssh is:

  1. Check whether vim supports X-11 clipboard: vim --version | grep clipboard. If it reports back -clipboard and -xterm_clipboard you should install either vim-gtk or vim-gnome (gvim on arch linux)

  2. Add the following lines to your .vimrc:

set clipboard=unnamedplusset paste
  1. If you login on a different machine via ssh, use the option -Y: ssh -Y machine

Now copying and pasting should work exactly as expected on a single, and across different machines by only using y for yank and p for paste. NB modify .vimrc on all machines where you want to use this feature.


Viewing all articles
Browse latest Browse all 39

Trending Articles