GNU Emacs arrow key binding solution

Curt McDowell cm26+ at andrew.cmu.edu
Sat Oct 27 09:10:00 AEST 1990


The following works for me.  Try adding it to your .emacs.  Note: you must
give up "esc-[" which is normally backward-paragraph.

; Make Sun and RT arrow keys work

(defvar esc-bracket-map (make-sparse-keymap)
         "*Keymap for ESC-[ encoded keyboard")

(progn
  (define-key esc-map "[" esc-bracket-map)	   ; Install esc-bracket-map
  (define-key esc-map "[A" 'previous-line)	   ; R8
  (define-key esc-map "[B" 'next-line)		   ; R14
  (define-key esc-map "[C" 'forward-char)	   ; R12
  (define-key esc-map "[D" 'backward-char)	   ; R10
  (define-key esc-map "[[" 'backward-paragraph))   ; the original esc-[

Curt McDowell
curt at ibm.com



More information about the Comp.sys.sun mailing list