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

[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: plus852
Subject: Re: Remap DEL and Shift-Up to kill to end of line
Date: Tue, 29 Apr 2008 08:49:04 -0700 (PDT)
User-agent: G2/1.0

On Apr 29, 12:50 am, David Hansen <david.han...@gmx.net> wrote:
> 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

Thanks very much -- the shift keys now work, including this one that I
added:

(global-set-key (kbd "<S-up>") 'kill-line)

But (global-set-key (kbd "<delete>") 'kill-line) still doesn't work -
all I get is a forward character delete (I'm running Emacs 22.1 on Mac
OS X)

Also, how would I bind Shift-Up Shift-Up to kill-paragraph (and Del-
Del if I can get Del working)? (global-set-key (kbd "<S-up><S-up>")
'kill-paragraph) doesn't do the job.

Thanks very much.


reply via email to

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