[SOLVED] Can't copy-paste from one terminal to another using vim
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can't copy-paste from one terminal to another using vim
I opened two text files with vim(different two konsole window).
Selecting some texts from one vim window yanked(y) then tried pasting(p) to other vim window.It doesn't work.
Code:
E353:Nothing in register "
"*y or "+y don't work.
What's the way to paste texts from one vim window to another?
1. On the source terminal, I use my mouse to select the block & right-click and select copy.
2. Then on the destination terminal, I right-click and select paste.
All you need to do is highlight the text with you mouse that you want to copy. It is automatically copied. Then in the window you want to paste into, go into insert mode, and then click your middle mouse button while pointing into that window.
HTH
Forrest
p.s. Just to add, "yy" yanks and "p" pastes.
Last edited by forrestt; 12-18-2009 at 03:39 AM.
Reason: added p.s.
All you need to do is highlight the text with you mouse that you want to copy. It is automatically copied. Then in the window you want to paste into, go into insert mode, and then click your middle mouse button while pointing into that window.
HTH
Forrest
It works if it's the same vim window.
But if they are different two vim windows then it doesn't work.
It works with any window be it vim or any other app. You do need to go into insert mode first (by pressing 'i' in the target window). Try again. This is how X windows has worked for as long as I've used it (since late 1980's). Highlighting any text automatically copies it to the X window buffer. Clicking the middle mouse button pastes it to the window under the mouse pointer.
Here's another thread about it. Basically it is controlled by an option in '/usr/share/vim/vimrc' or '~/.vimrc' or can be switched during runtime in vi with: ':set mouse=a' and ':set mouse=r'
I uninstalled elvis to which vi symlink points by default in slackware, and using vim middleclick pasteing works as expected after having set 'set mouse=r' in configuration file.
Last edited by veeall; 12-18-2009 at 04:08 AM.
Reason: r not a, sorry!
The mouse options screws with the way you do somethings. But! if you remember to use shift + highlight or shift + click then it will work. I believe gpm needs to be enabled.
this is because vim is compiled without x clipboard support on slackware. Obviously this does not affect gvim
You know I have this same issue for slackware --current, but not using 'vim' (as I don't use vi/vim/gvim - my brain don't work that way) ; I have this issue with nano using xterm.
Example:
step 1: have an xterm open
step 2: then highlight text (it should now be in clipboard/klipper)
step 3: nano somefile.txt
step 4: press mousewheel down, or use shift-insert to paste the text and what get's pasted is stuff that I had used 'control + c' key on earlier.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.