tags:

views:

56

answers:

3

I've tried the methods mentioned at http://stackoverflow.com/questions/677986/vim-copy-selection-to-os-x-clipboard, but neither the * or + register seem to be working for me. I'm on OpenSuSE 11.3, and have vim and vim-data installed (there is no vim-full package as mentioned in the link in SuSE). I've tried with Klipper enabled and disabled. (edit) I've also tried pasting with ctrl+v and middle click.

Thanks in advance.

A: 
  • Check synchronize contents of the clipboard and the selection in the clipper configuration.
  • Highlight text with the mouse (will not work with vim key selections).
  • Your selection is in the clipper.
nate c
I need something that will work with split windows. Thanks anyway.
gatoatigrado
+1  A: 

I presume that you are running VIM in terminal and talk about VIM's visual selection, not selection with the mouse in terminal window.

Since in your case VIM isn't aware of the X, it obviously cannot communicate your selection to the X Window System. If you select something in terminal window with mouse, then you are selecting not in VIM, but in the terminal emulator which is aware of the X and communicates properly the current selection to X's clipboard.

You can try to play around with xsel tool which allows one to access the X clipboard from command line. You would need to override the usual clipboard shortcuts to not only put the content of the visual selection into the usual VIM register(s), but also to pipe it to the xsel so that it becomes the new X selection. (Strangely enough, I do not have the xsel installed on the SLES10 system I have right now at hand.) That obviously would only work if (1) the terminal is running locally or (2) remote server you are connected to allows the X forwarding. If the X forwarding is disabled on the server where you edit the files, then you have no chance to do in VIM: only selecting with mouse in terminal window would work.

Dummy00001
Yeah, there's a range of these things like xclip and pbcopy, maybe one of those is installed (I have xclip, which is in package "xclip"). Thanks though.
gatoatigrado
+2  A: 

See if you have something called vimx, an X enabled version of vim. You can alias vim to that, and then use * register.

This is a superuser question.

I don't see it, but it works with <code>gvim</code>.
gatoatigrado