From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Raffaele Ricciardi Newsgroups: gmane.emacs.help Subject: Re: copy-line Date: Wed, 25 Jul 2012 16:02:11 +0100 Message-ID: References: <1341515294.71719.YahooMailNeo@web163106.mail.bf1.yahoo.com> <2b0503d9-5345-42b3-ad05-0d7bc2aad7a1@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1343225116 24599 80.91.229.3 (25 Jul 2012 14:05:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 25 Jul 2012 14:05:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 25 16:05:13 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Su2DA-0000Ae-Mz for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Jul 2012 16:05:12 +0200 Original-Received: from localhost ([::1]:50878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su2D9-0004LH-Sh for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Jul 2012 10:05:11 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-X-Trace: individual.net huwe7UAw73aDYUQypi9zWA2ZdJGtNVoJ1VCu3yGpGWZF8Xt91Osw1by1rAc284kI72 Cancel-Lock: sha1:fKhUKocAX11QCKH29X9DxIUnAHA= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: Original-Xref: usenet.stanford.edu gnu.emacs.help:193659 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86034 Archived-At: 's requirement is that for its was that you shouldn't ha.On 07/25/2012 02:41 PM, Dan Espen wrote:> 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 > > I meant: I don't know whether it is customizable via Customize, as the original poster asked for its .emacs to be left untouched. Thank you for the tip, though :-)