LinuxQuestions.org
Visit the LQ Articles and Editorials section
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
 
LinkBack Search this Thread
Old 02-20-2010, 12:30 AM   #31
speck
Member
 
Registered: Nov 2001
Location: California
Distribution: Slackware 13.1
Posts: 231

Rep: Reputation: 43

On a pretty stock Slackware 12.0, the "set mouse=r" option is all I need to provide. I ran the following test from an Xterm just to make sure (but I'm using Openbox only, not KDE).

Code:
1. mv -i ~/.vimrc ~/.vimrc.bak

2. vim /tmp/tmp.txt
    Highlighting in Firefox and middle click pasting into Vim does not work
    Highlighting in Vim and middle click pasting into Firefox does not work

3. echo "set mouse=r" > ~/.vimrc

4. vim /tmp/tmp.txt
    Highlighting in Firefox and middle click pasting into Vim now works
    Highlighting in Vim and middle click pasting into Firefox now works
 
Old 02-20-2010, 04:24 AM   #32
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Rep: Reputation: 92
I am using openSuSE, i had klipper (clip board tool) at the tray. When ever i select some text at any window and press copy ---- then it automatically copied and shown at klipper. Now i can see what are copied. Klipper has history manager. My klipper shows last 7 copied texts.
 
Old 02-20-2010, 04:12 PM   #33
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-13.37
Posts: 1,955

Rep: Reputation: 326Reputation: 326Reputation: 326Reputation: 326
This is an odd and needlessly complex discussion...

Hold shift while hilighting in vim to copy to the clipboard and then middle-click in any other app. When trying to paste *into* vim, just use Shift+Insert assuming you've copied to the system clipboard (the clipboard situation is very messy by default in Linux and is one of the worst designs IMO...to rectify this in WMs that don't handle this stuff as well as klipper or whatever other tool you may use, I always just set my terminal to copy to the primary buffer. urxvt makes this easy with perl extensions). The set mouse=a/r will work as well but you don't have to change that on-the-fly and exclude yourself from VISUAL mode...just hold shift.

Of course the real reason that this thread exists is that you cannot perform proper copying/pasting in vim using *registers* because it wasn't compiled with --with-x (which is annoying). It works properly in gvim but not in console vim, and the only way to fix this (so the clipboard is accessible using the system register in vim) is by recompiling.

Why has this thread reached so many pages?

[edit] Just checked, and shift+middle click works to paste into vim as well. So just hold shift while doing any standard hilighting/middle-clicking in vim and you're golden, and you can still use visual mode. Of course this is still incredibly stupid since it should have been compiled with --with-x in the first place, but I guess they were trying not to exclude those without X on their system. [/edit]

Last edited by T3slider; 02-20-2010 at 04:15 PM.
 
1 members found this post helpful.
Old 02-20-2010, 08:35 PM   #34
grissiom
Member
 
Registered: Apr 2008
Location: China, Beijing
Distribution: Slackware
Posts: 409

Original Poster
Rep: Reputation: 45
Thanks T3slider. The Shift modifier works like a charm So I will set mouse to a instead of r from now on. I've no idea why this thread got so loong(Oh, 3 pages). Maybe Shift is broken in the past
 
Old 06-04-2010, 08:59 AM   #35
armorsmith42
LQ Newbie
 
Registered: Jun 2008
Distribution: ubuntu
Posts: 1

Rep: Reputation: 0
What I did on debian Lenny:

1) sudo apt-get install vim-full
2) insert the following into my .vimrc
"""
set clipboard=unnamed
vnoremap y "*y
vnoremap Y "*Y
nnoremap p "*p
nnoremap P "*P
"""

now to copy, I press 'v' to enter visual highlight mode,
highlight the area I want to copy,
and press 'y' to yank it into the clipboard

to paste, I press 'p' from normal/command mode.

----
What this does:
vim uses multiple registers. I'm sure there are some ninjas out there who
switch between registers, but I only use one. the '*' register is the clipboard, so the last 4 commands just specify using that whenever you try to yank or paste.
I dont know if the first line is needed and I don't care.
 
Old 06-04-2010, 09:25 AM   #36
Richard Cranium
Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware
Posts: 754

Rep: Reputation: 178Reputation: 178
Quote:
Originally Posted by armorsmith42 View Post
What I did on debian Lenny:

1) sudo apt-get install vim-full
2) insert the following into my .vimrc
"""
set clipboard=unnamed
vnoremap y "*y
vnoremap Y "*Y
nnoremap p "*p
nnoremap P "*P
"""

now to copy, I press 'v' to enter visual highlight mode,
highlight the area I want to copy,
and press 'y' to yank it into the clipboard

to paste, I press 'p' from normal/command mode.

----
What this does:
vim uses multiple registers. I'm sure there are some ninjas out there who
switch between registers, but I only use one. the '*' register is the clipboard, so the last 4 commands just specify using that whenever you try to yank or paste.
I dont know if the first line is needed and I don't care.
While you undoubtedly happy using Debian Lenny, this is a Slackware forum. A solution that starts off with the "apt-get" command in a Slackware forum thread won't be very relevant. Not to mention other differences between Slackware and Debian.
 
Old 07-22-2011, 09:55 AM   #37
bk322
LQ Newbie
 
Registered: Jun 2011
Posts: 1

Rep: Reputation: Disabled
Well I'm on Kubuntu I put
set clipboard=unnamed
in .vimrc - and it enables me to interact with clipboard. All copy/paste commands - like dd - all work well through the clipboard.
 
  


Reply

Tags
vim


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
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
Clipboard Manager for quickly copy paste saurya_s Linux - Software 1 09-22-2005 09:33 AM
copy and paste not working (requested clipboard format not available) marie-p Linux - Software 1 01-23-2005 11:44 AM


All times are GMT -5. The time now is 10:58 PM.

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
Open Source Consulting | Domain Registration