Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have Ubuntu 11.04 desktop and a 11.04 VPS server.

After replacing vim with vim-gtk (I don't need GUI though), I'm able to use the system's clipboard in vim. I'd like to use the same feature in Ubuntu server, but it looks like it doesn't work with ssh -X.

Is there some way I can enable that feature or do I need to use nano for that?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

The "clipboard" is a feature of X11, so you will need to enable "X11 forwarding" for the SSH connection in "trusted" mode:

$ ssh -Y myserver

(By default, X11 is forwarded in "untrusted" mode, which is somewhat too restrictive. -Y disables the restrictions.)

Also make sure the server has xauth and a X11-capable version of vim installed. You can use xsel -o and xsel -o -b to verify that the clipboard can be accessed.


To make it permanent, add the following to your local ~/.ssh/config:

Host myserver
    ForwardX11 yes
    ForwardX11Trusted yes
share|improve this answer
    
I'm using vim-gtk in server and I can see using "vim --version" that X11 is enabled. There is nothing about xauth through. This is what I get: $ xsel -o xsel: Can't open display: (null) : Success –  jaz Aug 23 '11 at 12:38
    
"sudo apt-get install xauth" did the trick. –  jaz Aug 23 '11 at 14:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.