[CLUE-Tech] another vi question

Bruce Ediger eballen1 at qwest.net
Fri Apr 23 21:44:01 MDT 2004


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.




More information about the clue-tech mailing list