You are not logged in.

#1 2009-05-10 03:07:07

Tristan
Member
Registered: 2009-01-13
Posts: 8

[SOLVED] Copy from Vi to Firefox?

I'm running Openbox and I use Vi in xterm. I can copy and paste to and from xterm and firefox, but how do I copy text from Vi and paste it into Firefox?

Last edited by Tristan (2009-05-10 18:13:26)

Offline

#2 2009-05-10 03:13:47

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: [SOLVED] Copy from Vi to Firefox?

A middle-click should do the trick, otherwise if you use a clipboard manager such as Glipper, it should allow you to pick and choose which buffered text you want to paste.


thayer williams ~ cinderwick.ca

Offline

#3 2009-05-10 03:43:53

Tristan
Member
Registered: 2009-01-13
Posts: 8

Re: [SOLVED] Copy from Vi to Firefox?

The middle-click doesn't work. In Vi I highlighted the text and when I middle click in firefox, I get other stuff copied previously like text copied from xterm or firefox. Would glipper fix this problem, if so which version.

Offline

#4 2009-05-10 03:55:35

SamC
Member
From: Calgary
Registered: 2008-05-13
Posts: 611
Website

Re: [SOLVED] Copy from Vi to Firefox?

I know that the method thayer mentioned used to work for me, but it seems that it doesn't work anymore. If anyone does find a solution, please post it here.

Offline

#5 2009-05-10 04:11:16

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: [SOLVED] Copy from Vi to Firefox?

Offline

#6 2009-05-10 06:43:04

Tristan
Member
Registered: 2009-01-13
Posts: 8

Re: [SOLVED] Copy from Vi to Firefox?

Not really a fix, but instead of using vi, I just install vim (vim-7.2.65-1.1) from Extra and everything is working perfect.

Offline

#7 2009-05-10 06:46:59

Aprz
Member
From: Newark
Registered: 2008-05-28
Posts: 277

Re: [SOLVED] Copy from Vi to Firefox?

Save the file in Vi and open it in Firefox with ctrl + o? tongue

Offline

#8 2009-05-10 08:53:32

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [SOLVED] Copy from Vi to Firefox?

Hold shift while selecting text to override ncurses mouse grab.

Offline

#9 2009-05-10 11:21:33

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: [SOLVED] Copy from Vi to Firefox?

Copy (yank) with

"*y

and use middle-click to paste. * is the vim register corresponding to the "select/middle-click" clipboard.

Offline

#10 2009-05-10 12:55:15

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: [SOLVED] Copy from Vi to Firefox?

Another way:

set clipboard=unnamed

then you can yank with y and paste anywhere (w/ middle-click or shift-insert)

python: There should be one-- and preferably only one --obvious way to do it.
perl: There is more than one way to do it.

Offline

#11 2009-05-10 18:12:19

Tristan
Member
Registered: 2009-01-13
Posts: 8

Re: [SOLVED] Copy from Vi to Firefox?

Thanks for the help.

Offline

#12 2009-05-10 18:14:40

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: [SOLVED] Copy from Vi to Firefox?

Tristan wrote:

Thanks for the help.

Please let everyone know what solution that you used that so that this thread is helpful to others.

Offline

#13 2009-05-10 23:08:28

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Copy from Vi to Firefox?

0. The app/package is named "vi", not "vim", so maybe that's why not everything is working as expected.
1. A feature/bug.
2. @Ramses de Norre: '"*y' never worked for me, does it work for you or did you RTFM?

Last edited by karol (2009-05-10 23:13:32)

Offline

#14 2009-05-11 02:31:56

Tristan
Member
Registered: 2009-01-13
Posts: 8

Re: [SOLVED] Copy from Vi to Firefox?

skottish wrote:
Tristan wrote:

Thanks for the help.

Please let everyone know what solution that you used that so that this thread is helpful to others.

I used the solution given by Procyon. With vi, hold shift while selecting text and paste with middle click.
Also with vim I can select text and paste with middle click without holding shift.

Last edited by Tristan (2009-05-11 02:32:18)

Offline

#15 2009-05-11 09:52:56

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: [SOLVED] Copy from Vi to Firefox?

karol wrote:

@Ramses de Norre: '"*y' never worked for me, does it work for you or did you RTFM?

It does. Select text in visual mode, press esc :"*y and paste with middle click.

Offline

#16 2009-05-11 10:53:49

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Copy from Vi to Firefox?

Ramses de Norre wrote:

Select text in visual mode, press esc

Ummmm, aren't we at square one then?

I've even tried ':"*y' and ':"*y[return]' - still doesn't work. I've noticed I get a 'beep' ('bell', '\a', 'alarm', '\007' ...) when pressing '*'.

Offline

#17 2009-05-11 12:24:59

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: [SOLVED] Copy from Vi to Firefox?

karol wrote:

I've even tried ':"*y' and ':"*y[return]' - still doesn't work. I've noticed I get a 'beep' ('bell', '\a', 'alarm', '\007' ...) when pressing '*'.

You need to type those in command mode, after the ':'. So you first press ESC and ':' to go from visual to command mode again and then type "*y and press enter. You shouldn't get a terminal bell when entering commands in command mode...

Last edited by Ramses de Norre (2009-05-11 12:25:30)

Offline

#18 2009-05-11 12:55:16

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Copy from Vi to Firefox?

Well, I've tried it w/ many different distros in the past, and it never worked. I've used different computers and different mice - still nothing. The 'beep' was present only when I did '"*y' (w/o ':'), but still it didn't work. Maybe I have a program missing? Mouse server? Maybe it's not configured correctly? Maybe it's not running? Do I have enough milk in the fridge?
Anyway copying from vi(m) and pasting into f.e. Firefox via ':"*y' never worked and still does not. It's a bit annoying, that everyone but me can do this (it's the same wrt sex ;-) ). "I think I need a hug".

Attention: hybris ahead! (did I spell it correctly?)

karol wrote:

':"*y[return]'

- ':' - colon drops me to ex mode,
- '"' - double quotes, inch mark - is that right?
- '*' - star, Asterix ... I mean asterisk (I've tried both Shift-8 and NumPad *),
- 'y' - why,
- enter/return.

Try to paste it somewhere, anywhere, anyhow. Zilch.

Offline

#19 2009-05-11 13:55:48

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: [SOLVED] Copy from Vi to Firefox?

If you select something and then type ":reg" in vim, do you see the selected text in the * register?
If you type "*p (this time _not_ with a ':' ! Just type it), is the text pasted?

Offline

#20 2009-05-11 14:15:11

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Copy from Vi to Firefox?

Ramses de Norre wrote:

If you select something and then type ":reg" in vim, do you see the selected text in the * register?
If you type "*p (this time _not_ with a ':' ! Just type it), is the text pasted?

Don't think so.
"*p behaves just like plain 'p'.

Selecting in Vim in visual mode and then typing ':reg' results in an error.

vim wrote:

E481
No range allowed
A range was specified for an Ex command that doesn't permit one.  See |cmdline-ranges|.

I've checke the cmdline-ranges but found nothing interesting concerning this situation.
Simply typing ':reg' w/o selecting anything shows the registers list together w/ their contents, but I see neither "+ nor "*. The list starts w/ "" and ends w/ "/ .


Maybe we should let it go, it's probably an obscure bug or some config issue. If you want to continue, please PM me, because this thread is already marked as solved.

Offline

#21 2009-05-11 17:16:09

SnapShot
Member
Registered: 2008-08-26
Posts: 43

Re: [SOLVED] Copy from Vi to Firefox?

Select the text in vim visual mode and then type "+y (all three caharacters ", +, and y) this will copy (yank) the text in global clipboard. Then paste in firefox as usual. If you want the other way to paste from global clipboard into vim, use "+p to paste the text from global clipboard.

Offline

#22 2009-05-11 17:26:12

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Copy from Vi to Firefox?

Nope, it's not working. ':rec' doesn't show * and + registers.

Thanks, but for now I'll stick to holding shift while selecting. It's not pretty, I have to temporarily disable numbering lines, but it's doable. Vim has quite an array of options so I think it's simply misconfigured (although my setup is near-vanilla). Maybe I'll open a thread wrt to this issue some time.

Offline

#23 2009-05-11 18:30:38

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [SOLVED] Copy from Vi to Firefox?

I've noticed that "+y will properly yank text from vim to the X clipboard, but "*y will not.

Also, thanks for the tip about shift-highlight with the mouse in vim to allow copying to other X apps.

Scott

Offline

#24 2009-05-11 18:39:46

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Copy from Vi to Firefox?

Shift-highlight (remember to first let go LMB *then* Shift) is a temporary way of 'set mouse=r' I think.
I'm collecting links about similar issues to read sth during the weekend.

Offline

Board footer

Powered by FluxBB