[Top][All Lists]

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

Re: copy and paste multiple times

From: Teemu Likonen
Subject: Re: copy and paste multiple times
Date: Wed, 25 Jan 2012 19:35:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

* 2012-01-25T12:20:16-05:00 * Rajanikanth Jammalamadaka wrote:

> This has been discussed below:
> Is there no built-in (short :-)) command in emacs to copy and paste a
> region multiple times?

The Stack Overflow question is about copying *lines*, not *a region* as
you put it. Which one do you mean? Anyway, there is no as quick command
as Vi's "yy10p".

Possible solutions:

 1. Write a desired command yourself.
 2. Switch to viper-mode for a moment.
 3. Delete line with C-k C-k and then yank it several times with C-y.

My opinion is that yank command's numeric prefix argument should repeat
the yank. But Emacs is customizable and programmable, so I just do it:

    (global-set-key (kbd "C-y") (lambda (n)
                                  (interactive "p")
                                  (dotimes (i (abs n)) (yank))))

reply via email to

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