Define keys more easily?
Michael Markert
markert.michael at googlemail.com
Sat Aug 20 00:26:04 CEST 2011
Hi,
my key definitions come in packs, so instead of
#+begin_src emacs-lisp
(eval-after-load 'speedbar
'(progn
(evil-make-overriding-map speedbar-key-map)
(evil-make-overriding-map speedbar-file-key-map)
(evil-make-overriding-map speedbar-buffers-key-map)
(evil-define-key 'motion speedbar-key-map "h" 'backward-char)
(evil-define-key 'motion speedbar-key-map "j" 'speedbar-next)
(evil-define-key 'motion speedbar-key-map "k" 'speedbar-prev)
(evil-define-key 'motion speedbar-key-map "l" 'forward-char)
(evil-define-key 'motion speedbar-key-map "i" 'speedbar-item-info)
(evil-define-key 'motion speedbar-key-map "r" 'speedbar-refresh)
(evil-define-key 'motion speedbar-key-map "u" 'speedbar-up-directory)
(evil-define-key 'motion
speedbar-key-map "o" 'speedbar-toggle-line-expansion)
(evil-define-key
'motion speedbar-key-map (kbd "RET") 'speedbar-edit-line)))
#+end_src emacs-lisp
I like it
#+begin_src emacs-lisp
(eval-after-load 'speedbar
'(progn
(evil-make-overriding-map speedbar-key-map)
(evil-make-overriding-map speedbar-file-key-map)
(evil-make-overriding-map speedbar-buffers-key-map)
(evil-define-keys 'motion speedbar-key-map "h" 'backward-char
"j" 'speedbar-next
"k" 'speedbar-prev
"l" 'forward-char
"i" 'speedbar-item-info
"r" 'speedbar-refresh
"u" 'speedbar-up-directory
"o" 'speedbar-toggle-line-expansion
(kbd "RET") 'speedbar-edit-line)))
#+end_src emacs-lisp
Easier to type and easier to read and understand, right?
Is it worth to include it? And if, is it worth to keep the single key functions?
The code is in my keys branch[1].
I did not open a merge request because I don't want it included half finished
(the rest of the key functions).
Michael
Footnotes:
[1] https://gitorious.org/~cofi/evil/cofis-evil/commits/keys
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
Url : https://lists.ourproject.org/pipermail/implementations-list/attachments/20110820/1c3e7e3c/attachment.pgp
More information about the implementations-list
mailing list