3

I use vim inside terminal and trying to share the mac clipboard with vim.

Compiled vim with xterm_clipboard support and installed XQuartz.

MacBook-Air:web-ui nagakirank$ vim --version | grep xterm_clipboard
+xsmp_interact +xterm_clipboard -xterm_save

Nagas-MacBook-Air:web-ui nagakirank$ echo $DISPLAY
/tmp/launch-ltuLWk/org.macosforge.xquartz:0

But,am not able to get Mac clipboard content inside vim using "+" register "+y.

Now,clueless on why it's not working..Need pointers on how to debug this?

1 Answer 1

2

Try building Vim 7.3 with the clipboard feature enabled. Starting in Vim 7.3, +clipboard uses the OS X pasteboard directly (via the * or + register, as you expected).

It probably is possible to use +xterm_clipboard with an X server configured to convert X’s selection to and from the OS X pasteboard, but it would probably be more problematic than the direct +clipboard solution.


As an example, the MacPorts build of the vim port that I have currently installed (vim @7.3.661_0+huge+perl+python27+ruby+tcl) has +clipboard, -xterm_clipboard, and can access the pasteboard through * and +.

Also, if you happen to be running Vim inside tmux you will probably need my wrapper program to reenable pasteboard access inside tmux sessions; this only applies to +clipboard access: X-mediated access might still work OK—as long as you keep DISPLAY updated—but still seems unnecessarily cumbersome to me.

1
  • It's working fine when vim launched outside screen and problem is only with vim inside screen. Went through your post and found that screen installed via Ports has the patches to fix this. Installed screen via Ports and that solved the issue..Thanks..Haven't expected I would be able to solve this easily
    – Naga Kiran
    Commented Nov 28, 2012 at 10:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .