LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 12-18-2009, 02:56 AM   #1
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,019

Rep: Reputation: 63
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?

Slakcware 13+kde
 
Old 12-18-2009, 03:15 AM   #2
Kenichi Kato
Member
 
Registered: Jun 2007
Location: Asia
Distribution: Ubuntu, Fedora, CentOS & TCL
Posts: 62
Blog Entries: 1

Rep: Reputation: 16
Hi,

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.
Attached Images
File Type: jpg vimterminalscopypaste.jpg (108.6 KB, 7 views)
 
Old 12-18-2009, 03:21 AM   #3
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,019

Original Poster
Rep: Reputation: 63
No option if i do right click.
 
Old 12-18-2009, 03:27 AM   #4
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
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.
 
Old 12-18-2009, 03:29 AM   #5
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,019

Original Poster
Rep: Reputation: 63
Quote:
Originally Posted by forrestt View Post
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.
 
Old 12-18-2009, 03:49 AM   #6
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
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.

HTH

Forrest

Last edited by forrestt; 12-18-2009 at 03:50 AM.
 
Old 12-18-2009, 04:07 AM   #7
veeall
Member
 
Registered: May 2007
Location: Estonia
Distribution: Slackware 12.1, slackware64-current
Posts: 255

Rep: Reputation: 43
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!
 
1 members found this post helpful.
Old 12-18-2009, 04:19 AM   #8
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,019

Original Poster
Rep: Reputation: 63
Thanks veeall.
:set mouse=r and it works fine.
 
Old 12-18-2009, 05:14 AM   #9
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,019

Original Poster
Rep: Reputation: 63
This is solved.
 
Old 12-18-2009, 10:39 PM   #10
lumak
Member
 
Registered: Aug 2008
Location: Phoenix
Distribution: Arch
Posts: 799
Blog Entries: 32

Rep: Reputation: 109Reputation: 109
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

Last edited by lumak; 12-18-2009 at 11:08 PM.
 
Old 12-18-2009, 10:48 PM   #11
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 111Reputation: 111
For this and other nifty features relating to X, I symlink vim to gvim
 
Old 12-18-2009, 10:51 PM   #12
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,515

Rep: Reputation: 62
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.

It's driving me batty!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy and paste things between vim and system clipboard grissiom Slackware 43 09-30-2013 02:23 AM
copy-paste in vim proNick Linux - Newbie 5 02-17-2008 07:29 PM
How to copy paste into VIM ? EAD Linux - Software 15 12-12-2006 06:38 PM
Buggy copy n paste with vim in terminal Kovacs Slackware 1 09-05-2006 12:13 AM
cygwin vim copy/paste problem takahaya Linux - Software 2 03-31-2006 01:16 AM


All times are GMT -5. The time now is 09:40 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration