Estou executando o Emacs no urxvt com zsh as shell:
~ % echo $TERM && echo $SHELL
rxvt-256color
/bin/zsh
~ %
Meu problema atual é que não consigo obter a chave <& kbd> Home & kbd; Tecla End funcionando corretamente no Emacs.
Aqui está minha amostra .Xresources para keysbind:
URxvt.keysym.Home: 3[1~
URxvt.keysym.End: 3[4~
URxvt.keysym.C-Up: 3[1;5A
URxvt.keysym.C-Down: 3[1;5B
URxvt.keysym.C-Right: 3[1;5C
URxvt.keysym.C-Left: 3[1;5D
URxvt.keysym.Meta-Up: 3[1;3A
URxvt.keysym.Meta-Down: 3[1;3B
URxvt.keysym.Meta-Right: 3[1;3C
URxvt.keysym.Meta-Left: 3[1;3D
URxvt.keysym.S-Up: 3[1;2A
URxvt.keysym.S-Down: 3[1;2B
URxvt.keysym.S-Right: 3[1;2C
URxvt.keysym.S-Left: 3[1;2D
Eu pude configurar Ctrl + setas e Shift + setas graças a este arquivo rxvt.el encontrado na web (graças ao autor).
~ % cat ~/.emacs.d/rxvt.el
[...]
(define-key function-key-map "3[1;5A" [(control up)])
(define-key function-key-map "3[1;5B" [(control down)])
(define-key function-key-map "3[1;5D" [(control left)])
(define-key function-key-map "3[1;5C" [(control right)])
(define-key function-key-map "3[1;2A" [(shift up)])
(define-key function-key-map "3[1;2B" [(shift down)])
(define-key function-key-map "3[1;2D" [(shift left)])
(define-key function-key-map "3[1;2C" [(shift right)])
[...]
Aqui estão as linhas referentes a Início & Fim :
~ % cat ~/.emacs.d/rxvt.el
[...]
(define-key function-key-map "3[1~" [home])
(define-key function-key-map "3[4~" [end])
(define-key function-key-map "3[7~" [find])
(define-key function-key-map "3[2~" [insert])
(define-key function-key-map "3[8~" [select])
(define-key function-key-map "3[5~" [prior])
(define-key function-key-map "3[6~" [next])
[...]
E adicionei essas linhas ao arquivo .emacs, mas sem efeito:
~ % cat ~/.emacs
[...]
;;default configuration for home & end key
(global-set-key [home] 'beginning-of-line)
(global-set-key [end] 'end-of-line)
Aqui está o que o comando sudo showkey
informa sobre Início & Fim :
<user>@localhost ~ % sudo showkey
[sudo] password for <user>:
kb mode was ?UNKNOWN?
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]
press any key (program terminates 10s after last keypress)...
keycode 28 release
^[[1~keycode 102 press //home key was pressed
keycode 102 release
^[[4~keycode 107 press //end key was pressed
keycode 107 release
keycode 29 press
^Ccaught signal 2, cleaning up...
Alguém tem algum conselho?
Talvez também ajude se eu disser que o Ctrl + A funciona e tem o mesmo comportamento que eu quero para Home e Ctrl + E para Fim .