Vim (terminal) - copy to clipboard and paste while paused

I have vimx installed, so I can copy vimx to the x clipboard using "+y etc., which works fine as long as I can maintain the current vimx.

However, I also like to switch to the current working shell using 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 pause vim with ctr-z , the x-clipboard becomes empty until I return vim to fg again.

+4
source share
2 answers

fine

After about an hour of dizziness this problem, I decided to use a different approach to do the same.

I will talk in detail about what I did here for those who have the same problem.

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

I understand that it can be hard to get wxcopy , under a Fedora package that provides:

WindowMaker

+2
source

This is not an answer, like a push in the right direction, but start here:

 :help quoteplus :help x11-cut-buffer 

In particular, in the text of the second help there are some interesting notes on the suspension of vim. It claims to write a buffer in PRIMARY and CUT_BUFFER0, so you can use the middle click after you pause it. Maybe you removed those or a plugin that interferes? Perhaps you are using an old version of vim (I am running 7.2.182).

My suggestion is to disable all plugins that you installed manually and try vanilla vim. If this does not work, consider using vim -V (verbose) and see if it tries to put a buffer in PRIMARY or CUT_BUFFER0 before it is blocked.

I don't have vim compiled with X (vimx), so I can't verify this myself. Hope this helps you in the right direction.

+1
source

Source: https://habr.com/ru/post/1309718/


All Articles