unable to access default clipboards #191

orsenthil opened this Issue Oct 20, 2012 · 27 comments


None yet

#153 and #155 makes changes to the clipboard support. This is breaking the previous good behavior of system clipboard access. Previous I used to yank, copy and use " (default) or * as the registers. Only this is not possible. I can only use named registers if I have copy and paste. Unavailability of default registers is a hindrance.

Mine is vim 7.3 on Mac OS X, with -xterm_clipboard and set clipboard=unnamed

👍 for spf13-vim


wolfgangpfnuer commented Nov 23, 2012

Did you recently switch your vim binary?

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.


I had the exact same issue. I even compiled vim from scratch with --enable-clipboard=yes and --enable-xterm_clipboard=yes to no avail. I ended up commenting out set clipboard=unnamed from my .vimrc file.


spf13 commented Nov 28, 2012

Does this fe6ea83 resolve the issue here?

Yes, that fixes the problem. I can now share the clipboard between terminal vim and MacVim. Thanks for you help.

Is this still using the " + y command? I am having issues despite updating to the latest of spf13 (did notice a warning about vim not being compiled with python, is this a requirement?)

Using MacVim & vim in iTerm it works with the native y command, without a need to define a buffer using the quote mark. Although, my version of vim does have python support. (I compiled it using homebrew, which I highly recommend using.)

Is it in your global clipboard?

Yes, and it's quite handy when working with other programs.

omares commented Feb 26, 2013

Same issue, cant copy paste into/from the global clipboard.

vim version gives me following output. Installed via brew on a Mac OS X 10.7.5.

21:50:27 ~ ❯ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Feb 26 2013 15:06:43)
MacOS X (unix) version
Included patches: 1-831
Compiled by ME!
Huge version without GUI.  Features included (+) or not (-):
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         -gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
+clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   -perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            +ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    
+farsi           +mouse_netterm   +syntax          
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: /usr/bin/clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX -no-cpp-precomp  -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.7 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: /usr/bin/clang   -L. -L/usr/local/opt/rbenv/versions/1.9.3-p392/lib  -L/usr/local/lib -o vim        -lm  -lncurses -liconv -framework Cocoa    -framework Python   -lruby-static -lobjc -L/usr/local/opt/rbenv/versions/1.9.3-p392/lib

Am i missing something out?

omares commented Feb 26, 2013

It seems when installing vim via brew none of the buildin if conditions, regarding the clipboard setting, validate. So the clipboard variable is empty.

I solved the issue by adding the set clipboard=unnamed to my .vimrc.local


wolfgangpfnuer commented Feb 27, 2013

@omares you had -xterm_clipboard.
maybe that was the problem? you should have +xterm_clipboard and +clipboard afaik.

omares commented Feb 27, 2013

No its definitively a problem with the set clipboard code and evaluation. Checking the variable in vim with set clipboard? gives me clipboard=

After adding the variable setting to my .vimrc.local the same check gives me clipboard=unnamed and it copy pastes into the * register by default.

If you're using Kubuntu, install the package vim-gtk and NOT vim. Vim installs vim-tiny that has no system clipboard support. On Ubuntu, install vim-gnome.

Thanks, installing vim-gnome fixed it for me.

Could anyone share the spf13 configured for CentOS6.5, having pyton2.6

One solution of problem with pasting a content from X clipboard is to find and comment in .vimrc this line:
"set mouse=a ( but mouse will not be available in all vim modes)
You can paste a content from X clipboard by pressing p or P in Normal mode, or by right click in Insert mode.
If you still use the mouse a lot may would be better to change it to:
set mouse=n
Mouse will be available in vim Normal mode and you can move the cursor and paste a content from X clipboard by pressing p or P, or in Insert mode you can paste by right click under present cursor position.

spf13 closed this Jun 30, 2014

@Dariusz-Choinski Thanks for that. I am used to Ctrl+Shift+C and Ctrl+Shift+V for copy/pasting in the shell and could not do that with out-of-the-box spf13 settings. Putting this here for future reference.

hchiao commented Nov 25, 2014

@jaywilliams how do you reinstall spf13-vim with the flags --enable-clipboard=yes and --enable-xterm_clipboard=yes? I am using the command curl http://j.mp/spf13-vim3 -L -o - | sh to install, how should I add the flags in that command?


jrobeson commented Nov 25, 2014

spf-vim doesn't install vim for you. you have to make sure your installed vim has those.

I used custom compile flags in Homebrew to compile my own version of Vim.

EricYT commented Apr 20, 2015

How to fix the problem in centos that -clipboard?Thanks all.


jrobeson commented Apr 20, 2015

you have to compile vim yourself @EricYT , or find someone elses package of someone who did that.

EricYT commented Apr 20, 2015

@jrobeson I compiled it by myself and installed the vim-X11.But still not work!Now I'm ready to download the vim-gnome package if there is one for centos 7.

zx1986 commented Oct 26, 2016

How could I disable this feature?
When I dd in vim, I got things that delete in vim into my clipboard,
I don't want that ...

I can't do cmd+c in my Mac terminal vim too. When using mouse select text, vim enter visual mode, cmd+c is disabled. Esc will exit visual mode, but the text is no longer selected. PLZ help to copy text from vim to system clipboard so I can copy to a browser.

charpty commented Jun 10, 2017

I can't do cmd+c in my Mac terminal vim too....


wolfgangpfnuer commented Jun 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment