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

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

Re: copy-line


From: Dan Espen
Subject: Re: copy-line
Date: Wed, 25 Jul 2012 09:41:15 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

rfflrccrd@gmail.com writes:

> Comparing Vi/Vim to other editors is not fair ;-)
>
> Vanilla Emacs has no way to copy text that has not been marked.  Thus, to 
> copy a line, you have to mark it first.  The complete sequence is:
>
> C-a C-Space C-e M-w
>
> In alternative, you can kill a line and yank it back at once:
>
> C-S-Backspace C-k
>
> Unlike Vi, the line will be copied/killed without its new line.  I don't know 
> whether such behaviour is customizable.

It certainly is customizable:

(define-key global-map [(kp-add)] '(lambda () (interactive)
                                     (beginning-of-line)
                                     (if (eobp) (error "End of buffer"))
                                     (let ((beg (point)))
                                       (forward-line 1)
                                       (kill-region beg (point))))); KeyPad + 
Key

Kill a line, yank it back:

C-KP+ C-y


-- 
Dan Espen


reply via email to

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