[nSLUG] copy/paste...web-->vim...unexpected results

Jack Warkentin jwark at eastlink.ca
Sun Feb 4 22:46:08 AST 2007


Hi Bob

Cut/Copy and Paste are inherently GUI capabilities. M$ Windows 
implemented these via menu items but they occurred long before in 
X-Windows using *only* the mouse - select with the left mouse button, 
which automatically copies to the X-clipboard, and paste with the 
middle mouse button. (There are extended capabilities for varying how 
mouse selection occurs using ctrl and alt keys while mousing.) To cut 
instead of copy, simply use the Backspace (ie ctrl-H) key to delete 
after selecting.

With no GUI running, there was for a long time no cut/copy/paste 
mechanism. Then along came gpm and its predecessors. With this 
running, it should be possible to cut, copy and paste *with the 
mouse* in console mode. (I am unable to test this on my system 
because my console keeps reporting, ever second or so, that my cd-rom 
drive has no disc installed. So far I have been unable to discover 
how to get rid of this message. Any help with this would be 
appreciated.) But I used to use this from time to time with previous 
machines and distros. In this case the mouse cursor appeared as a 
rectangle the size of one screen character. It certainly saved a lot 
of time when issuing commands - copy a portion of the previous 
command, or its results, and paste into the next command.

I don't know if this will work between a command-line window (eg xterm 
or konsole) in X-Windows and using the console directly, ie by 
switching between the GUI and the console using ctrl-alt-<some 
function key>.

The ctrl-X, ctrl-C, ctrl-V keyboard shortcuts were invented by 
Microsoft and implemented in X-Windows to various extents, mostly 
application-dependent. Also, as has been pointed out, in X-Windows 
there are different buffers for storing the copied stuff, depending 
on the application and the method using for selection. I do know for 
certain that I can easily copy text from Mozilla into a text file 
using vi and the mouse. Of course, as has been pointed out, you must 
be in insert mode in vi in order to paste (but not to select).

I may have some details wrong here. Anybody who can make corrections, 
please do. But I am pretty sure of my basic facts here.

Hope this helps.

Regards

Jack

On Sunday 04 February 2007 19:05, Robert Ashley wrote:
> On 2/4/07, Ben Armstrong <synrg at sanctuary.nslug.ns.ca> wrote:
> 
> > Either select the text and then paste the selection register in 
vim, or select and copy (or cut) the text, normally via ^C (or ^X), 
and then paste the system clipboard in vim:
> >
> > "+p             for the system clipboard
> > "*p             for the selection register
> 
> This works fine within the X windows environment, but it doesn't
> work when pasting from an X-environment app to the console. They're
> not cooperating.
> 
> > Or see "help x11-selection" from within vim.
> 
> This was instructive reading, elaborating on your distinction
> between the + and * registers. This help section, however, restricts
> its discussion to x11 only, without reference to copy/paste between
> x11 and non-x11 (console) environments.
> 
> I continue to assume the limitation is me not knowing enough about
> what the heck I'm doing.  And, it's got me further doubting myself
> about why I'm trying to get more at home in the no-frills console.
> After all, redundancy abounds if I can open a terminal window within
> x-windows, or 66 of them or whatever. Why do I need the console
> array (Ctrl + Alt + f1...fn)?
> 
> Probably for the same psychological impulse which impelled me to get
> a manual, push-reel lawnmower, even though I've already got a
> gas-powered job in the shed.
> 
> :-)
> 
> bob
> 
> 
> 
> _______________________________________________
> nSLUG mailing list
> nSLUG at nslug.ns.ca
> http://nslug.ns.ca/cgi-bin/mailman/listinfo/nslug
> 
> 
> 
> 

-- 
Jack Warkentin, phone 902-404-0457, email jwark at eastlink.ca
39 Inverness Avenue, Halifax, Nova Scotia, Canada, B3P 1X6

!DSPAM:45c69a7340024587522852!




More information about the nSLUG mailing list