tags:

views:

255

answers:

2

I have vimx installed, so I can copy in vimx to the x clipboard by using "+y and the like, which works well as long as I can keep the current vimx running.

However, I also love to be able to switch to the current running shell with ctrl-z and be able to paste what I copied from vim into the shell. Does anyone know how to do this, because as soon as I suspend vim with ctr-z the x-clipboard becomes empty, until I put vim into the fg again.

+1  A: 

This isn't an answer as much as a push in the right direction, but start here:

:help quoteplus
:help x11-cut-buffer

Specifically the second help text has some interesting notes about suspending vim. It claims to write the buffer into PRIMARY and CUT_BUFFER0 so you can still use middle click after you've suspended. Maybe you've deleted those or a plugin is interfering? Maybe you are running an old version of vim (I'm running 7.2.182).

My suggestion is to disable all plugins you've manually installed and try vanilla vim. If that doesn't work, consider using vim's -V (verbose) flag and see if it will try to put the buffer into PRIMARY or CUT_BUFFER0 before it actually gets suspended.

I don't have vim compiled with X (vimx) so I can't actually test this myself. Hopefully that gets you in the right direction.

xyld
Thanks, I read that section over carefully, and it seems that vim should be moving the buffer into the X-clipoard right before it becomes suspended or unavailable, but somehow its not on my system. Either the documentation is faulty or something is not right with my get up. I dont have any plugins installed all I can think of is I might be doing something funny in my vimrc.
ldog
@gmatt did using -V reveal anything? whats your .vimrc look like?
xyld
sorry for the tardy response, I tried vimx plain vanilla, no changes to vimrc or plugins, but still get the same problem, looks like the documentation is wrong.
ldog
+1  A: 

ok,

After about an hour of head bashing this issue, I have decided to use a different approach to do the same thing.

I will detail what I did here for the benefit of those with the same issue.

If you have wxcopy on your system that is enough to get copy/paste support on your system between vim and other apps. If you want to copy from vim, select the text using v or V or whatever method you prefer, then use the command :tee >(wxcopy). This will copy that code into the oldschool X11 cut buffer. This buffer has the added bonus of not requiring the parent application to be running for pasting to work, hence my problem goes away.

I realize it may be hard to get your hands on wxcopy, under fedora the package that provides it is:

WindowMaker

ldog
xclip should do the trick an you dont need to install WindowMaker. xclip is a nice small app for X11 and shouldnt depend on your window manager. Didnt know about this before, pretty nifty actually.
xyld