You are not logged in.

#1 2008-12-20 02:25:55

hack.augusto
Member
From: Brazil
Registered: 2008-08-28
Posts: 124

vim + urxvt + x.org integration

Often I found myself in trouble to get some text from a file that I'm editing with vim under urxvt to another application, such as emesene and this forum or even another console driven app, the "solution" is normally use cat file | grep -C <lines> <stuff> and copy from there selecting the text and pasting it with "middle mouse key", this is quite uncorfotable because I use a laptop and didn't buy a mouse yet : \ - and I'm not planning to do it also - and take lots of steps, I'm sure there is lots of ways to do that, but I would like a way to exchange the text between the tty and X, ideas? - I'm using ratpoison, and on tty normally I use gnu screen, if anyone already have solutions for this ... -

Offline

#2 2008-12-20 03:21:45

Square
Member
Registered: 2008-06-11
Posts: 435

Re: vim + urxvt + x.org integration

Screen has a special copy mode that you can use. (check 'man screen' for details.)
Shift+Insert does the same as middle click, so you don't need a middle mouse button. big_smile
And vim has visual mode... etc...


 

Offline

#3 2008-12-20 03:38:49

tom5760
Member
From: Philadelphia, PA, USA
Registered: 2006-02-05
Posts: 283
Website

Re: vim + urxvt + x.org integration

You could use Vim's registers.  Register "+" (plus) is for the X clipboard.  Simply yank some text into that register, and then CTRL+V or Middle click wherever to paste.

For example:

"+yw

(Thats a double quote)  This will yank one word to the X clipboard.  Double quotes, then a letter or symbol, selects a register to yank into.

Also, you can use visual mode (v) or (Shift + v) to highlight a bunch of text, then hit "+y to grab it all.

Conversely, you can paste from the X clipboard with that register.  Copy some text in Firefox, then type "+p to paste it into vim

See:

:help registers

to read all about Vim's registers.

Offline

#4 2008-12-20 13:13:34

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: vim + urxvt + x.org integration

Assuming you are saying console and meaning a terminal emulator like urxvt, try holding shift down when you hilight text, then middle clicking elsewhere.  That's what I've got to use to copy things from vim.

Last edited by rson451 (2008-12-20 13:13:53)


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

Board footer

Powered by FluxBB