Vim Tips Wiki
Register
m (delete extra coma)
Tag: Visual edit
(48 intermediate revisions by 29 users not shown)
Line 4: Line 4:
 
|id=984
 
|id=984
 
|previous=983
 
|previous=983
|next=985
+
|next=987
|created=September 4, 2005
+
|created=2005
 
|complexity=basic
 
|complexity=basic
 
|author=JimD
 
|author=JimD
 
|version=6.0
 
|version=6.0
 
|rating=30/17
 
|rating=30/17
|category1=
+
|category1=Integration
 
|category2=
 
|category2=
 
}}
 
}}
 
One of the traditional disconnects between vi and modern graphical environments has been using mouse-driven copy/paste between a terminal or command prompt window, and any other application (for example, a web browser).
 
One of the traditional disconnects between vi and modern graphical environments has been using mouse-driven copy/paste between a terminal or command prompt window, and any other application (for example, a web browser).
   
Vim has extended vi to allow use of the * register as a reference to the system clipboard. So we can use normal mode commands like: <tt>"*dd</tt> or <tt>1G"*yG</tt> to copy things into the * register and <tt>"*p</tt> to paste text from it. We can also use this * register with the ex yank command, so <tt>:%y *</tt> will accomplish the same goal as <tt>gg"*yG</tt> (copy all text into the system clipboard so it can be pasted into an X or MS Windows application).
+
Vim has extended vi to allow use of the * register as a reference to the system clipboard. So we can use normal mode commands like: <code>"*dd</code> or <code>1G"*yG</code> to copy things into the * register and <code>"*p</code> to paste text from it. We can also use this * register with the ex yank command, so <code>:%y *</code> will accomplish the same goal as <code>gg"*yG</code> (copy all text into the system clipboard so it can be pasted into an X or MS Windows application).
   
 
The * register acts just like any of the normal (single letter) registers in vi except that it also refers to the system clipboard in X11 or MS Windows.
 
The * register acts just like any of the normal (single letter) registers in vi except that it also refers to the system clipboard in X11 or MS Windows.
   
I've also found that it's ''much'' faster and more reliable than pasting a large body of text into Vim through an xterm. Normally I run Vim under the Linux screen utility and any more than one screen full of text is often corrupted, and large selections (>10KB) take several seconds of gnashing and flashing to finish pasting (almost always corrupted). By contrast, pasting 100KB text using <tt>"*p</tt> is very reliable and fast.
+
I've also found that it's ''much'' faster and more reliable than pasting a large body of text into Vim through an xterm. Normally I run Vim under the Linux screen utility and any more than one screen full of text is often corrupted, and large selections (>10KB) take several seconds of gnashing and flashing to finish pasting (almost always corrupted). By contrast, pasting 100KB text using <code>"*p</code> is very reliable and fast.
   
 
I searched though the tips and found only a few passing references to this feature: [[VimTip71]] (implies it's a feature of gvim, but I find it works in console Vim just fine under Linux; I only use gvim under MS Windows). [[VimTip771]] and [[VimTip964]] refer to an extra utility named xclip which is only for X11 and seems to be completely unnecessary for Vim using the * register), and [[VimTip960]] (misses the point but the comments mention it a few times).
 
I searched though the tips and found only a few passing references to this feature: [[VimTip71]] (implies it's a feature of gvim, but I find it works in console Vim just fine under Linux; I only use gvim under MS Windows). [[VimTip771]] and [[VimTip964]] refer to an extra utility named xclip which is only for X11 and seems to be completely unnecessary for Vim using the * register), and [[VimTip960]] (misses the point but the comments mention it a few times).
   
 
[[VimTip21]] is spot on but the title suggests it's for MS Windows only. It also mentions that we can change out settings so the "anonymous" register is aliased to the * register using:
 
[[VimTip21]] is spot on but the title suggests it's for MS Windows only. It also mentions that we can change out settings so the "anonymous" register is aliased to the * register using:
 
 
<pre>
 
<pre>
 
set clipboard=unnamed
 
set clipboard=unnamed
 
</pre>
 
</pre>
  +
  +
: '''Note:''' in vim 7.3.74 and higher you can set <code>clipboard=unnamedplus</code> to alias unnamed register to the + register, which is the X Window clipboard.
   
 
[[VimTip432]] and [[VimTip600]] use the * register in some native Vim code (using @*) without explaining it in general. [[VimTip448]] also uses it (for converting hex to decimal) but explains it in passing. [[VimTip478]] uses it in a function for copying the results of a :g search into the * register. [[VimTip687]] suggests that Mac OS X doesn't implement the * register (yet?) but suggests a workaround using the pbcopy and bppase utilities. [[VimTip876]] also makes passing reference to it.
 
[[VimTip432]] and [[VimTip600]] use the * register in some native Vim code (using @*) without explaining it in general. [[VimTip448]] also uses it (for converting hex to decimal) but explains it in passing. [[VimTip478]] uses it in a function for copying the results of a :g search into the * register. [[VimTip687]] suggests that Mac OS X doesn't implement the * register (yet?) but suggests a workaround using the pbcopy and bppase utilities. [[VimTip876]] also makes passing reference to it.
Line 41: Line 42:
 
</pre>
 
</pre>
   
If you see "<tt>+xterm_clipboard</tt>", you are good to go. If it's "<tt>-xterm_clipboard</tt>", you will need to look for a version of Vim that was compiled with clipboard support. I have found that the Vim that ships with Ubuntu has clipboard support, but the one with Redhat/CentOS does not.
+
If you see "<code>+xterm_clipboard</code>", you are good to go. If it's "<code>-xterm_clipboard</code>", you will need to look for a version of Vim that was compiled with clipboard support. I have found that the Vim that ships with Ubuntu has clipboard support (not vim-tiny, you need vim-gnome or vim-gtk), but the one with Redhat/CentOS does not.
   
If you are running Redhat/CentOS, you can install the vim-X11 package (if you have gvim then this is already installed). This provides the vimx command, which is a console version of Vim with X11-clipboard support. I like aliasing Vim to vimx by adding this line to my .bashrc/.cshrc:
+
If you are running Redhat/CentOS, you can install the vim-X11 package (if you have gvim then this is already installed). This provides the vimx command, which is a console version of Vim with X11-clipboard support. Or if you are running Debian(only test on 7.0), installing vim-gnome package fixs the problem. I like aliasing Vim to vimx by adding this line to my .bashrc/.cshrc:
   
 
<pre>
 
<pre>
.bashrc: if [ -e /usr/bin/vimx ]; then alias vim='/usr/bin/vimx'; fi
+
.bashrc or .zshrc: if [ -e /usr/bin/vimx ]; then alias vim='/usr/bin/vimx'; fi
 
.cshrc: if (-e /usr/bin/vimx) alias vim '/usr/bin/vimx'
 
.cshrc: if (-e /usr/bin/vimx) alias vim '/usr/bin/vimx'
 
</pre>
 
</pre>
  +
  +
If you are running Gentoo, emerge vim with the 'vim-with-x' USE flag.
   
 
Some basic clipboard commands:
 
Some basic clipboard commands:
*<tt>"+2yy</tt> &ndash; copy two lines to X11 clipboard
+
*<code>"+2yy</code> &ndash; copy two lines to X11 clipboard
*<tt>"+dd</tt> &ndash; cut line to X11 clipboard
+
*<code>"+dd</code> &ndash; cut line to X11 clipboard
*<tt>"+p</tt> &ndash; paste X11 clipboard
+
*<code>"+p</code> &ndash; paste X11 clipboard
  +
  +
==See also==
  +
*[[Using the Windows clipboard in Cygwin Vim]]
   
 
==Comments==
 
==Comments==
Line 60: Line 66:
 
Text selected, or otherwise highlighted in one X11 app is available in the selection buffer, and text explicitly copied or cut is available in the cut buffer.
 
Text selected, or otherwise highlighted in one X11 app is available in the selection buffer, and text explicitly copied or cut is available in the cut buffer.
   
----
 
I found + register only works for gvim under X11. In text Vim, + is equal to * register. Still cannot figure out how to paste content from clipboard to text Vim.
 
 
----
 
 
All my inter-window copy & paste to gvim is handled by the <F7> key. This works for all OSes only for gvim.
 
All my inter-window copy & paste to gvim is handled by the <F7> key. This works for all OSes only for gvim.
   
Line 76: Line 78:
 
cmap <F7> <C-r><C-o>z
 
cmap <F7> <C-r><C-o>z
 
"copy register
 
"copy register
  +
 
autocmd FocusGained * let @z=@+
 
autocmd FocusGained * let @z=@+
 
</pre>
 
</pre>
   
 
----
 
----
 
The + and * registers do ''not'' work running Vim under cygwin without an X session (for instance running Vim directly from a cmd or rxvt window). They also don't work under Mac OS X using Vim from the command line (via Terminal.app or iTerm.app). This should be documented (as should workarounds).
   
  +
:For such systems, {{script|id=2098|text=fakeclip plugin}} provides comprehensive and extensible emulation for the clipboard registers.
The + and * registers do NOT work running vim under cygwin without an X session (for instance running vim directly from a CMD or rxvt window). They also don't work under Mac OS X using vim from the command line (via Terminal.app or iTerm.app). This should be documented (as should work-arounds).
 
   
 
----
 
----
  +
in response to above comment (cygwin vim sans X session), as of the software versions below, there doesn't seem to be any problems using the "* register in or outside of rxvt, in a cmd window:
  +
  +
WinXP (SP3)<br>
  +
cygwin (2.831)<br>
  +
rxvt (20050409-21)<br>
  +
vim (7.3.1314-1)<br>
 
----
  +
If you're having trouble with GVIM on Ubuntu, and it doesn't seem to be doing what everybody is saying it should, try closing it completely and reopening. It's supposed to "just work" in the case of copy-paste integration with the system clipboard, especially if you use GVIM's GUI buttons or menus. However, sometimes it just stops working, and you have to close and reopen.
  +
  +
The Ubuntu vim-gtk package contains the +xterm_clipboard option, while the standard vim package does not ...
  +
 
----
  +
If for some reason your version of vim under Unix-like system has no support for clipboard, you can use a handy utility called xsel. Xsel lets you manipulate X selections (check man xsel for more info).
  +
To work around the lack of clipboard I use following mappings:
  +
<pre>
  +
" Copy to X CLIPBOARD
  +
map <leader>cc :w !xsel -i -b<CR>
  +
map <leader>cp :w !xsel -i -p<CR>
  +
map <leader>cs :w !xsel -i -s<CR>
  +
" Paste from X CLIPBOARD
  +
map <leader>pp :r!xsel -p<CR>
  +
map <leader>ps :r!xsel -s<CR>
  +
map <leader>pb :r!xsel -b<CR>
  +
</pre>
  +
  +
So, to paste from X clipboard, you use :r!xsel -p|-s|-b depending which X clipboard you want to access. To copy, use <code>:w!xsel -i -p|-s|-b</code>.
  +
----
  +
  +
This was recently added, but there is no indication why it is useful or needed. I have moved it here for now because to my knowledge the normal clipboard access commands should work and are much more desireable.
  +
  +
--[[User:Fritzophrenic|Fritzophrenic]] 17:30, November 8, 2010 (UTC)
  +
  +
----
  +
I am running ubuntu 10.04 with vim-gtk. The * register works as described for gvim but not the command line.
  +
vim --version does show the " +xterm_clipboard" option. This is version 7.2.
  +
  +
:I had a similar issue on Ubuntu 14.04. It turns out the default clipboard setting is <code>"autoselect,exclude:cons\|linux"</code> and I was changing it with <code>set clipboard+=unnamedplus</code>, which turned it into <code>"autoselect,exclude:cons\|linux,unnamedplus"</code>. However, according to the help page for ''clipboard-exclude'', the exclude option must come last. Changing my code to <code>set clipboard^=unnamedplus</code> solved the problem by prepending the ''unnamedplus'' setting, rather than appending it.
  +
:BTW, I have Vim GNOME 7.4.52 from the Ubuntu repositories, and <code>clipboard=unnamed</code> uses the X clipboard, while <code>clipboard=unnamedplus</code> uses the (GNOME) System Clipboard.
  +
:--[[User:LeahCim|LeahCim]] ([[User talk:LeahCim|talk]]) 02:01, September 1, 2014 (UTC)
  +
  +
----
  +
I have found using the [http://www.nongnu.org/autocutsel/ autocutsel] package on X11 in conjunction with set clipboard=unnamed provides a seamless experience.
  +
  +
==Simple workaround for X clipboards==
  +
There is a convenient workaround to create a few commands for pasting/copying selections into/out of various X11 clipboards with `xsel`.
  +
<pre>
  +
:command -range Cz :silent :<line1>,<line2>w !xsel -i -b
  +
:command -range Cx :silent :<line1>,<line2>w !xsel -i -p
  +
:command -range Cv :silent :<line1>,<line2>w !xsel -i -s
  +
:cabbrev cv Cv
  +
:cabbrev cz Cz
  +
:cabbrev cx Cx
  +
  +
:command -range Pz :silent :r !xsel -o -b
  +
:command -range Px :silent :r !xsel -o -p
  +
:command -range Pv :silent :r !xsel -o -s
  +
  +
:cabbrev pz Pz
  +
:cabbrev px Px
  +
:cabbrev pv Pv
  +
</pre>
  +
  +
With this code blob dumped in your ~/.vimrc you can do the following
  +
  +
1. Select a blob of text in visual mode
  +
2. Step into command line with ':'
  +
3.
  +
:`<,`>cz
  +
  +
and your selected text will be copied into one of X's 3 default clipboards.
  +
  +
there are 6 commands, 3 for pasting, 3 for copying, and each command represents a buffer.
  +
<pre>
  +
z = "X11-Clipboard"
  +
x = "X11 Primary Selection"
  +
v = "X11 Secondary Selection"
  +
</pre>
  +
  +
==DISPLAY environment variable on Linux systems==
  +
  +
Make sure your DISPLAY environment variable is set appropriately - otherwise vim can not connect to your x-session to access the clipboard.
  +
  +
To check run:
  +
  +
<pre>
  +
echo $DISPLAY
  +
</pre>
  +
  +
which should output something like:
  +
  +
<pre>
  +
:0.0
  +
</pre>
  +
  +
----
  +
  +
==Workaround using x11 minimum packages (under Linux)==
  +
If nothing work and you would like to copy from vim (under xterm) to leafpad, you may use this add-on to your ~/.vimrc
  +
  +
Press F9, and it will copy to the x11 clipboard.
  +
  +
<pre>
  +
function Func2X11()
  +
:call system('xclip -selection c', @r)
  +
endfunction
  +
vnoremap <F9> "ry:call Func2X11()<cr>
  +
vnoremap <m-c> "ry:call Func2X11()<cr>
  +
vnoremap <ESC-c> "ry:call Func2X11()<cr>
  +
</pre>
  +
  +
I hope that it may help you.
  +
  +
==Workarounds for xterm==
  +
If <code>:version</code> shows "<code>+xterm_clipboard</code>", but using the clipboard still does not work, try using other system tools as a workaround. For example, you can search for a clipboard.sh script which can be used like '<code>cat a.txt | clipboard</code>' to copy the contents of file a.txt to the system clipboard. When using kubuntu, the system clipboard is managed by 'Klipper', you can use 'Klipper' shortcut to paste anything to the system clipboard from anywhere because its shortcut has the highest precedence. --Changc11, October 10, 2013
  +
:Has a case like this been discussed at the vim_use mailing list? If clipboard support is provided by Vim, and if the versions of Vim and the system are not excessively old, the clipboard should work. This idea is better as a comment until something more conclusive is known. [[User:JohnBeckett|JohnBeckett]] ([[User talk:JohnBeckett|talk]]) 10:27, October 13, 2013 (UTC)

Revision as of 02:03, 1 September 2014

Duplicate tip

This tip is very similar to the following:

These tips need to be merged – see the merge guidelines.

Tip 984 Printable Monobook Previous Next

created 2005 · complexity basic · author JimD · version 6.0


One of the traditional disconnects between vi and modern graphical environments has been using mouse-driven copy/paste between a terminal or command prompt window, and any other application (for example, a web browser).

Vim has extended vi to allow use of the * register as a reference to the system clipboard. So we can use normal mode commands like: "*dd or 1G"*yG to copy things into the * register and "*p to paste text from it. We can also use this * register with the ex yank command, so :%y * will accomplish the same goal as gg"*yG (copy all text into the system clipboard so it can be pasted into an X or MS Windows application).

The * register acts just like any of the normal (single letter) registers in vi except that it also refers to the system clipboard in X11 or MS Windows.

I've also found that it's much faster and more reliable than pasting a large body of text into Vim through an xterm. Normally I run Vim under the Linux screen utility and any more than one screen full of text is often corrupted, and large selections (>10KB) take several seconds of gnashing and flashing to finish pasting (almost always corrupted). By contrast, pasting 100KB text using "*p is very reliable and fast.

I searched though the tips and found only a few passing references to this feature: VimTip71 (implies it's a feature of gvim, but I find it works in console Vim just fine under Linux; I only use gvim under MS Windows). VimTip771 and VimTip964 refer to an extra utility named xclip which is only for X11 and seems to be completely unnecessary for Vim using the * register), and VimTip960 (misses the point but the comments mention it a few times).

VimTip21 is spot on but the title suggests it's for MS Windows only. It also mentions that we can change out settings so the "anonymous" register is aliased to the * register using:

set clipboard=unnamed
Note: in vim 7.3.74 and higher you can set clipboard=unnamedplus to alias unnamed register to the + register, which is the X Window clipboard.

VimTip432 and VimTip600 use the * register in some native Vim code (using @*) without explaining it in general. VimTip448 also uses it (for converting hex to decimal) but explains it in passing. VimTip478 uses it in a function for copying the results of a :g search into the * register. VimTip687 suggests that Mac OS X doesn't implement the * register (yet?) but suggests a workaround using the pbcopy and bppase utilities. VimTip876 also makes passing reference to it.

There are several tips for copying the current filename into the clipboard including: VimTip432, VimTip891, VimTip600 (most of the fuss is resolving forward slashes and backslashes for MS Windows paths).

X11-clipboard support in terminal

Getting Vim to work with the X11 clipboard can be a struggle, at least when you like to run Vim in a terminal. The GUI version of Vim always has clipboard support, however, if you like to use Vim from a terminal, you will have to check for X11-clipboard support.

From the console, type:

% vim --version

If you see "+xterm_clipboard", you are good to go. If it's "-xterm_clipboard", you will need to look for a version of Vim that was compiled with clipboard support. I have found that the Vim that ships with Ubuntu has clipboard support (not vim-tiny, you need vim-gnome or vim-gtk), but the one with Redhat/CentOS does not.

If you are running Redhat/CentOS, you can install the vim-X11 package (if you have gvim then this is already installed). This provides the vimx command, which is a console version of Vim with X11-clipboard support. Or if you are running Debian(only test on 7.0), installing vim-gnome package fixs the problem. I like aliasing Vim to vimx by adding this line to my .bashrc/.cshrc:

.bashrc or .zshrc: if [ -e /usr/bin/vimx ]; then alias vim='/usr/bin/vimx'; fi
.cshrc: if (-e /usr/bin/vimx) alias vim '/usr/bin/vimx'

If you are running Gentoo, emerge vim with the 'vim-with-x' USE flag.

Some basic clipboard commands:

  • "+2yy – copy two lines to X11 clipboard
  • "+dd – cut line to X11 clipboard
  • "+p – paste X11 clipboard

See also

Comments

Under Windows, the * and + registers are equivalent. For X11 systems, though, they differ. For X11 systems, * is the selection, and + is the cut buffer (like clipboard).

Text selected, or otherwise highlighted in one X11 app is available in the selection buffer, and text explicitly copied or cut is available in the cut buffer.

All my inter-window copy & paste to gvim is handled by the <F7> key. This works for all OSes only for gvim.

"copy
vmap <F7> "+ygv"zy`>
"paste (Shift-F7 to paste after normal cursor, Ctrl-F7 to paste over visual selection)
nmap <F7> "zgP
nmap <S-F7> "zgp
imap <F7> <C-r><C-o>z
vmap <C-F7> "zp`]
cmap <F7> <C-r><C-o>z
"copy register

autocmd FocusGained * let @z=@+

The + and * registers do not work running Vim under cygwin without an X session (for instance running Vim directly from a cmd or rxvt window). They also don't work under Mac OS X using Vim from the command line (via Terminal.app or iTerm.app). This should be documented (as should workarounds).

For such systems, fakeclip plugin provides comprehensive and extensible emulation for the clipboard registers.

in response to above comment (cygwin vim sans X session), as of the software versions below, there doesn't seem to be any problems using the "* register in or outside of rxvt, in a cmd window:

WinXP (SP3)
cygwin (2.831)
rxvt (20050409-21)
vim (7.3.1314-1)


If you're having trouble with GVIM on Ubuntu, and it doesn't seem to be doing what everybody is saying it should, try closing it completely and reopening. It's supposed to "just work" in the case of copy-paste integration with the system clipboard, especially if you use GVIM's GUI buttons or menus. However, sometimes it just stops working, and you have to close and reopen.

The Ubuntu vim-gtk package contains the +xterm_clipboard option, while the standard vim package does not ...


If for some reason your version of vim under Unix-like system has no support for clipboard, you can use a handy utility called xsel. Xsel lets you manipulate X selections (check man xsel for more info). To work around the lack of clipboard I use following mappings:

" Copy to X CLIPBOARD
map <leader>cc :w !xsel -i -b<CR>
map <leader>cp :w !xsel -i -p<CR>
map <leader>cs :w !xsel -i -s<CR>
" Paste from X CLIPBOARD
map <leader>pp :r!xsel -p<CR>
map <leader>ps :r!xsel -s<CR>
map <leader>pb :r!xsel -b<CR>

So, to paste from X clipboard, you use :r!xsel -p|-s|-b depending which X clipboard you want to access. To copy, use :w!xsel -i -p|-s|-b.


This was recently added, but there is no indication why it is useful or needed. I have moved it here for now because to my knowledge the normal clipboard access commands should work and are much more desireable.

--Fritzophrenic 17:30, November 8, 2010 (UTC)


I am running ubuntu 10.04 with vim-gtk. The * register works as described for gvim but not the command line. vim --version does show the " +xterm_clipboard" option. This is version 7.2.

I had a similar issue on Ubuntu 14.04. It turns out the default clipboard setting is "autoselect,exclude:cons\|linux" and I was changing it with set clipboard+=unnamedplus, which turned it into "autoselect,exclude:cons\|linux,unnamedplus". However, according to the help page for clipboard-exclude, the exclude option must come last. Changing my code to set clipboard^=unnamedplus solved the problem by prepending the unnamedplus setting, rather than appending it.
BTW, I have Vim GNOME 7.4.52 from the Ubuntu repositories, and clipboard=unnamed uses the X clipboard, while clipboard=unnamedplus uses the (GNOME) System Clipboard.
--LeahCim (talk) 02:01, September 1, 2014 (UTC)

I have found using the autocutsel package on X11 in conjunction with set clipboard=unnamed provides a seamless experience.

Simple workaround for X clipboards

There is a convenient workaround to create a few commands for pasting/copying selections into/out of various X11 clipboards with `xsel`.

:command -range Cz :silent :<line1>,<line2>w !xsel -i -b
:command -range Cx :silent :<line1>,<line2>w !xsel -i -p
:command -range Cv :silent :<line1>,<line2>w !xsel -i -s
:cabbrev cv Cv
:cabbrev cz Cz
:cabbrev cx Cx

:command -range Pz :silent :r !xsel -o -b
:command -range Px :silent :r !xsel -o -p
:command -range Pv :silent :r !xsel -o -s

:cabbrev pz Pz
:cabbrev px Px
:cabbrev pv Pv

With this code blob dumped in your ~/.vimrc you can do the following

1. Select a blob of text in visual mode
2. Step into command line with ':'
3.
   :`<,`>cz

and your selected text will be copied into one of X's 3 default clipboards.

there are 6 commands, 3 for pasting, 3 for copying, and each command represents a buffer.

z = "X11-Clipboard"
x = "X11 Primary Selection"
v = "X11 Secondary Selection"

DISPLAY environment variable on Linux systems

Make sure your DISPLAY environment variable is set appropriately - otherwise vim can not connect to your x-session to access the clipboard.

To check run:

echo $DISPLAY

which should output something like:

:0.0

Workaround using x11 minimum packages (under Linux)

If nothing work and you would like to copy from vim (under xterm) to leafpad, you may use this add-on to your ~/.vimrc

Press F9, and it will copy to the x11 clipboard.

function Func2X11()
:call system('xclip -selection c', @r)
endfunction
vnoremap <F9> "ry:call Func2X11()<cr>
vnoremap <m-c> "ry:call Func2X11()<cr>
vnoremap <ESC-c> "ry:call Func2X11()<cr>

I hope that it may help you.

Workarounds for xterm

If :version shows "+xterm_clipboard", but using the clipboard still does not work, try using other system tools as a workaround. For example, you can search for a clipboard.sh script which can be used like 'cat a.txt | clipboard' to copy the contents of file a.txt to the system clipboard. When using kubuntu, the system clipboard is managed by 'Klipper', you can use 'Klipper' shortcut to paste anything to the system clipboard from anywhere because its shortcut has the highest precedence. --Changc11, October 10, 2013

Has a case like this been discussed at the vim_use mailing list? If clipboard support is provided by Vim, and if the versions of Vim and the system are not excessively old, the clipboard should work. This idea is better as a comment until something more conclusive is known. JohnBeckett (talk) 10:27, October 13, 2013 (UTC)