Skip to content

Instantly share code, notes, and snippets.

@yewton
Created July 17, 2012 16:59
Show Gist options
  • Save yewton/3130598 to your computer and use it in GitHub Desktop.
Save yewton/3130598 to your computer and use it in GitHub Desktop.
key-chord setting
;; 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