[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Delete (kill) entire line at cursor - how?
From: |
Giorgos Keramidas |
Subject: |
Re: Delete (kill) entire line at cursor - how? |
Date: |
Tue, 06 Mar 2007 23:00:03 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (berkeley-unix) |
cmr.Pent@gmail.com writes:
>> I just made the below hack. Add it to your ~/.emacs file. Then,
>> restart emacs and, C-x y will do what you ask (I think). There's
>> probably a better way to do it:
>>
>> Matt Flaschen
>>
>> (defun kill-entire-line ()
>> "Kills the whole line, including terminating newline, and moves the
>> cursor directly down"
>> (interactive)
>> (next-line 1)
>> (save-excursion
>> (previous-line 1)
>> (beginning-of-line)
>> (kill-line 1)))
>>
>> (global-set-key [?\C-x ?y] 'kill-entire-line)
>
> Just checked it, works like a champ! Thanks.
>
> And I use stable version (21.4 that is), so the `kill-whole-line'
> command is unavailable to me.
It was introduced in Emacs 22, that's why :)
> Maybe it does exactly what Matt suggested ;-)
It does. You can also bind it to any key you want, instead of the
default <C-S-backspace>. So if you like hitting C-k to use it, instead
of the default, you can bind it to this key in your ~/.emacs file with:
(global-set-key (kbd "C-k") 'kill-whole-line)
Have fun,
Giorgos
- Delete (kill) entire line at cursor - how?, cmr . Pent, 2007/03/06
- Re: Delete (kill) entire line at cursor - how?, Matthew Flaschen, 2007/03/06
- Re: Delete (kill) entire line at cursor - how?, thorne, 2007/03/06
- Message not available
- Re: Delete (kill) entire line at cursor - how?, cmr . Pent, 2007/03/06
- Re: Delete (kill) entire line at cursor - how?,
Giorgos Keramidas <=
- Re: Delete (kill) entire line at cursor - how?, Matthew Flaschen, 2007/03/06
- Re: Delete (kill) entire line at cursor - how?, Dave Benjamin, 2007/03/07
- Re: Delete (kill) entire line at cursor - how?, Matthew Flaschen, 2007/03/07
- Message not available
- Re: Delete (kill) entire line at cursor - how?, cmr . Pent, 2007/03/07
- Re: Delete (kill) entire line at cursor - how?, Matthew Flaschen, 2007/03/07
- Re: Delete (kill) entire line at cursor - how?, anoop aryal, 2007/03/14
- Re: Delete (kill) entire line at cursor - how?, Matthew Flaschen, 2007/03/22
- Re: Delete (kill) entire line at cursor - how?, David Hansen, 2007/03/22
- Re: Delete (kill) entire line at cursor - how?, Matthew Flaschen, 2007/03/22
- Re: Delete (kill) entire line at cursor - how?, anoop aryal, 2007/03/26