From Chen's Wiki

Jump to: navigation, search

Determine the support

vim --version | grep clipboard

If it shows:

 -xterm_clipboard

This means you haven't the support for the system clipboard for vim yet.

All you need to do is:

sudo apt-get install vim-gui-common

Usage

Once you have the plus sign before xterm_clipboard, this means you can use the + or the * register to access the system clipboard.

To specify the register to use in vim, you do

 "<the_register_name><action>

For example, yanking the current line to the system clipboard:

"+yy

Copy the system clipboard in vim:

"+p