[CLUE-Tech] another vi question

David Willson DLWillson at TheGeek.NU
Sat Apr 24 00:40:34 MDT 2004


on the topic of vi, or maybe off it...
How do I do 'rectangular selections'?  Anywhere will do.  I thought you
could do it in a shell-session, but I'll be darned if I can figure out
how...
----- Original Message ----- 
From: "Bruce Ediger" <eballen1 at qwest.net>
To: <clue-tech at clue.denver.co.us>
Sent: Friday, April 23, 2004 9:44 PM
Subject: Re: [CLUE-Tech] another vi question


> On Sat, 24 Apr 2004, thadphole wrote:
>
> > suppose i need to copy some characters or words from a line, not the
> > entire line, how will i do that, e.g.
> > i want to copy the first 5 charcters of this sample to next line:
> >
> > vbvb(llll)
> > ^^^^^
>
> A better way probably exists, but here's how I'd do it:
>
> vbvb(llll)
> ^
> |
> +- put cursor here
> Then this magic key sequence: 5xPj0P
>
> That amounts to:
> 5x - delete 5 characters, which puts them in an un-named buffer.
> P  - put them back, in front of the cursor.
> j  - Go down a line
> 0  - Go to beginning of line
> P  - put the un-named buffer's contents in front of the cursor.
>
> In "vim", you can use 'v' mode to highlight the characters, then hit y
> to yank the highlighted characters into the un-named buffer.  Use whatever
> keys to move to where you want the contents of the un-named buffer,
> then P.
>
> _______________________________________________
> CLUE-Tech mailing list
> Post messages to: CLUE-Tech at clue.denver.co.us
> Unsubscribe or manage your options:
http://clue.denver.co.us/mailman/listinfo/clue-tech
>




More information about the clue-tech mailing list