Created
July 17, 2012 16:59
-
-
Save yewton/3130598 to your computer and use it in GitHub Desktop.
key-chord setting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; key-chord | |
(require 'key-chord) | |
(key-chord-mode 1) | |
(devar key-chord-bindings | |
'(("hf" . describe-function) | |
("hb" . describe-bindings) | |
("hv" . describe-variable) | |
("rs" . replace-string) | |
("rp" . replace-regexp) | |
("a;" . goto-line) | |
("xf" . find-file) | |
("::" . other-window) | |
("ys" . yas/expand) | |
("kk" . kill-this-buffer) | |
(";;" . next-buffer) | |
("aa" . previous-buffer) | |
("ss" . svn-status) | |
("??" . key-chord-describe-bindings) | |
("!!" . key-chord-set-bindings)) | |
"List of keybind-function pair") | |
(defun key-chord-set-bindings () | |
"Set global bindings according to `key-chord-bindings`" | |
(interactive) | |
(mapc | |
(lambda (pair) | |
(key-chord-define-global (car pair) (cdr pair))) | |
key-chord-bindings)) | |
(key-chord-set-bindings) | |
(defun key-chord-describe-bindings () | |
(interactive) | |
(message | |
(mapconcat | |
(lambda (pair) | |
(format "%-4s %s" | |
(car pair) | |
(symbol-name (cdr pair)))) | |
key-chord-bindings | |
"¥n"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment