> Hi,
>
> How can I provide a repeat count to yank -�
>
> I'd like to kill a line and then paste it 100 times - how can I
> achieve this?
C-x ( C-y C-u 100 C-x )
--
David Kastrup
> How can I provide a repeat count to yank -
>
> I'd like to kill a line and then paste it 100 times - how can I achieve this?
You can put the yank into a keyboard macro and use the prefix argument
to call the macro 100 times.
--
Peter
> Hi,
> How can I provide a repeat count to yank -
>
> I'd like to kill a line and then paste it 100 times - how can I
> achieve this?
>
> Regards,
> Kashyap
>
>
I was looking at this recently.
http://stackoverflow.com/questions/71985/emacs-equivalent-of-vims-yy10p
ulp!
M-: (loop repeat 5 do (progn (yank) (insert "\n")))
--
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
nice, and what about that:
(defun yank-repeat (&optional arg)
(interactive "p")
(dotimes (i arg)
(insert (car kill-ring))))
> M-: (loop repeat 5 do (progn (yank) (insert "\n")))
Of course we include the newline in the last kill and do this:
M-: (dotimes (i 4) (yank))
Or use this:
(defun yank-repeatedly (n)
(interactive "NHow many times: ")
(dotimes (i n)
(yank)))
> You can put the yank into a keyboard macro and use the prefix argument
> to call the macro 100 times.
That would be `C-x ( C-y C-x )' to define the macro (and as a side
effect do a single yank), and then `C-u 99 C-x e' to execute the macro
99 times (to get the remaining 99 yanks).
It's less effort than you might think, since creating a keyboard macro
for a repetitive task, is something you do frequently once you've
discovered it (at least I did).
I advised `yank' so that C-u 100 C-y yanks 100 times instead (which is
much more useful in my opinion):
(defadvice yank (around damd-yank first nil activate)
"If ARG is neither nil nor \\[universal-argument], yank ARG times.
Otherwise, use the original definition of `yank'."
(if (or (not arg)
(consp arg))
ad-do-it
(dotimes (i arg)
(yank))))
Deniz
>>>>>> pml...@free.fr (Peter Münster):
>
>> You can put the yank into a keyboard macro and use the prefix argument
>> to call the macro 100 times.
>
> That would be `C-x ( C-y C-x )' to define the macro (and as a side
> effect do a single yank), and then `C-u 99 C-x e' to execute the macro
> 99 times (to get the remaining 99 yanks).
Easier to do C-x ( C-y C-u 100 C-x ) I think.
--
David Kastrup