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

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

Re: copy and paste multiple times


From: Rajanikanth Jammalamadaka
Subject: Re: copy and paste multiple times
Date: Wed, 25 Jan 2012 12:37:52 -0500



On Wed, Jan 25, 2012 at 12:35 PM, Teemu Likonen <tlikonen@iki.fi> wrote:
* 2012-01-25T12:20:16-05:00 * Rajanikanth Jammalamadaka wrote:

> This has been discussed below:
> http://stackoverflow.com/questions/71985/emacs-equivalent-of-vims-yy10p
>
> 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))))

Thanks for the replies and short functions. I meant copy and paste a region multiple times.

Raj
reply via email to

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