[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Remap DEL and Shift-Up to kill to end of line
From: |
David Hansen |
Subject: |
Re: Remap DEL and Shift-Up to kill to end of line |
Date: |
Tue, 29 Apr 2008 06:50:03 +0200 |
User-agent: |
Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux) |
On Mon, 28 Apr 2008 18:02:26 -0700 (PDT) plus wrote:
> On Apr 28, 8:21 pm, plus...@gmail.com wrote:
>> I'm not sure how to remap keys, but I'd like to remap DEL (not
>> backspace/delete) and Shift-Up to kill to end of line (in addition to
>> C-k); I'd also like DEL-DEL and Shift-Up Shift-Up (DEL or Shift-Up
>> typed twice without any other input) to kill to end of paragraph. Is
>> this possible?
>
> I've tried adding to my .emacs file:
>
> (global-set-key (kbd "<delete>") 'kill-line)
Works fine here, which emacs version do you use? Maybe some major-mode
or minor-mode keymap is in the way (maybe worth a bug report, but I'm
not sure what the policy about these useless keys is).
> Also, I'd like Shift-Right to move 10 characters right and Shift-Left
> to move 10 characters left. Thanks.
(global-set-key (kbd "<S-left>") #'(lambda ()
(interactive)
(backward-char 10)))
(global-set-key (kbd "<S-right>") #'(lambda ()
(interactive)
(forward-char 10)))
Just use the output of C-h k as an argument to `kbd', works always.
Do you know about universal argument?
C-u C-f -> forward 4 chars
C-u C-u C-f -> forward 4*4=16 chars
M-1 M-0 C-f -> forward 10 chars
C-4 C-2 C-f -> forward 42 chars
David