Le 31 mai 07 à 15:14, Ajay Gupta a écrit :

Hi All,

I saw one of my friends (once!) copying the text from the line right
above. He was using some keycombo and it would appear like he was
copying the characters one-by-one. So, if there are two lines like

quick brown fox
I see

and on the 2nd line, after 'see', i wanted to copy 'brown fox' from
the 1st line, I will just keep pressing that keycombo 9 times.

I know how to copy the full line, text till some character, etc. But,
I was just wondering how to do the above. Does anybody know how to do
this?

thanks...
Ajay

Hi,

first you do the following :
- go on the second line
- press 'qq'          " start to record in q register
- then 'k0xj$p'    " the motion to iterate
- finally 'q'           " leave register recording

then to use the register, do :
- go on the second line
- press '@q'
- iterate until the full line is copied

(as usual you can use eg. [EMAIL PROTECTED] to iterate 5 times in once)


More on registers with ':help complex-repeat'

Vincent

Reply via email to