>From: Suresh Govindachar [mailto:sgovindachar@...]
>Sent: Friday, January 30, 2004 7:18 PM
>Subject: Re: splicing two sections of code? --difference between yank
>let to a register
>----- Original Message -----
>From: "gumnos (Tim Chase)" <gumnos@...>
>To: "Suresh Govindachar" <sgovindachar@...>
>Sent: Friday, January 30, 2004 3:32 PM
>Subject: Re: splicing two sections of code?
>>> In such a case, the desired rearrangement can be had by
>>> the following steps (which requires some elbow grease):
>>> 1) nmap <F5> NjyyNkpj (replace N by the actual number)
>>> 2) go to the first line and hit <F5> N times
>>> 3) N dd
>>This was similar to the solution I ended up with (before reading
>>beaut), only I used macro recording, and prefixed the playback with N.
>Just an observation about the difference between
>yanking and let'ting to a register:
>I had tried yanking the line:
>to register a and issuing the normal command
>5@a and it didn't work -- and so I resorted to
>elbow grease. After Tim's remark, I thought
>some more -- yanking to the register was the
>wrong thing to do (because of the carriage return?)
>:let @a='5jyy5kpj' followed by 5@a works as expected.
This depends on the way you yank the data ...
"ayy is a linewise yank, which includes ^J at the end
"ay$ is a character-wise yank, and does not
"ay with a visual region is character-wise or line-wise,