You are not logged in.
Say I'm editing a program with vim through a terminal (say xterm). Does anyone know how to copy the contents, via left click highlighting, onto the system clipboard (x11) when the content that needs to be copied is physically off the screen? I've tried to arrow up while highlighting but it doesn't work.
Offline
I've never tried this (and I can't check because I'm in Windows at the moment).
http://vim.sourceforge.net/tips/tip.php?tip_id=71
Also, take a look at the 'x11-selection' section of the Vim docs (http://ianua.initd.org/vimit/vim63/html/gui_x11.html)
Offline
I've never tried this (and I can't check because I'm in Windows at the moment).
http://vim.sourceforge.net/tips/tip.php?tip_id=71
Also, take a look at the 'x11-selection' section of the Vim docs (http://ianua.initd.org/vimit/vim63/html/gui_x11.html)
Thanks arooaroo but I'm still not seeing it.
What I'm looking for is the ability to highlight above or below what is on the physical screen. Like say you highlight this page by left clicking and drag it up above the actuall text area say into the forward and back buttons on your web browser the selection of your text moves up on the page until you move it down again then the selection stops. Thats what I'm looking for.
Offline
But you're in an xterm. You can't do that. You have to use vim's visual mode to select the text with cursor keys, then send to the clipboard.
Offline
arooaroo, vim keeps it's own buffer. I've never managed to copy something from the vim buffer to X11's buffer. And that's probably because I didn't read the manual properly
Offline
toxic, from what I understand from t-dawg's questions is that he wants to emulate what you can do in gvim, but with vim instead.
In gvim, I can click the mouse button; hold; drag downwards and then gvim will start scrolling downwards, whilst highlighting the passing lines. This is how you highlight large amounts of text (greater than what can fit in a single screen at a time) with a mouse.
However, terminals are slightly dumber. Whilst you can highlight areas of text, that's a console function and not something that vim itself is monitoring. Therefore, you can't achieve the same effect with the mouse in vim as you can in gvim.
Of course, vim is perfectly capable of selecting more text than can fit in a single screen. It has a visual mode. Press v and then move down with your cursor keys, et volia - highlighted text.
Now when it comes to shifting this to X11's clipboard, I've never tried (hence the link I gave for possible help). I'm sure it can be done.
Offline
Under arch, vim is compiled with minimal options - installing gvim makes the vim binary "more capable" - adding python, perl, ruby support as well as enabling +xterm_clipboard.
With +xterm_clipboard enabled, the * register maps to the X11 clipboard. (:h quotestar). Therefore, yanking to this register uses the same syntax as any other register:
"*y
To yank an entire file into X11s clipboard:
gg"*yG
Offline
However, terminals are slightly dumber. Whilst you can highlight areas of text, that's a console function and not something that vim itself is monitoring. Therefore, you can't achieve the same effect with the mouse in vim as you can in gvim.
Not always. In *good* terminals (urxvt, xterm, maybe others), you can use terminal vim's "ttymouse" mode.
I use
set ttymouse=xterm
set mouse=a
Check the help for full info about these options. As far as I know ttymouse=xterm2 is only supported in xterm. The difference is in dragging. ttymouse=xterm does not report the mouse position when dragging, only on mouse presses, so you don't get a highlight until a mouse-up.
Offline
So to answer the original question:
Say I'm editing a program with vim through a terminal (say xterm). Does anyone know how to copy the contents, via left click highlighting, onto the system clipboard (x11) when the content that needs to be copied is physically off the screen? I've tried to arrow up while highlighting but it doesn't work.
First, install gvim, but keep using vim.
With the mouse:
set ttymouse=xterm2
set mouse=a
" use the same clicky way you would in gvim
Without the mouse:
gg"*yG
Offline
"*y
Excellent! That worked with -X switch in vim. Thanks alot guys.
Offline