help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Repeat count for yanking


From: Andreas Röhler
Subject: Re: Repeat count for yanking
Date: Tue, 05 Jul 2011 19:27:23 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.18) Gecko/20110616 SUSE/3.1.11 Thunderbird/3.1.11

Am 05.07.2011 14:44, schrieb Thierry Volpiatto:
Perry Smith<pedzsan@gmail.com>  writes:

On Jul 5, 2011, at 6:46 AM, Richard Riley wrote:

C K Kashyap<ckkashyap@gmail.com>  writes:

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

If it is a one time thing, I usually do it in powers of two.  e.g. yank it 
maybe 4 times, then kill that and yank 4 times.  Now you have 16 lines.  ...

Remember that M-<  sets the mark.  So if you narrow the region you can paste a 
lot of lines rather quickly.

If I was going to do this moderately frequently, I would toy around and learn 
how to do it via M-; (eval).  Seems like one line of lisp could do this.


M-: (loop repeat 5 do (progn (yank) (insert "\n")))


nice, and what about that:

(defun yank-repeat (&optional arg)
  (interactive "p")
  (dotimes (i arg)
    (insert (car kill-ring))))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]