[Top][All Lists]

[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: Gecko/20110616 SUSE/3.1.11 Thunderbird/3.1.11

Am 05.07.2011 14:44, schrieb Thierry Volpiatto:
Perry Smith<address@hidden>  writes:

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

C K Kashyap<address@hidden>  writes:

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?


I was looking at this recently.

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]