You are not logged in.
Pages: 1
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
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
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
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
Offline
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
Save the file in Vi and open it in Firefox with ctrl + o?
Offline
Hold shift while selecting text to override ncurses mouse grab.
Offline
Copy (yank) with
"*y
and use middle-click to paste. * is the vim register corresponding to the "select/middle-click" clipboard.
Offline
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
Thanks for the help.
Offline
Thanks for the help.
Please let everyone know what solution that you used that so that this thread is helpful to others.
Offline
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
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
@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
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
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
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?)
':"*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
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
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.
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
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
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
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
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
Pages: 1