From: Peng Li Date: Thu, 3 Sep 2015 16:34:24 +0000 (+0800) Subject: emacs add mapping of keychord X-Git-Url: http://47.100.26.94:8080/?a=commitdiff_plain;h=5a883339d74021115be65ab7f3ad71ba2ab6ff76;hp=13f8919cf244d4a8f73d0bd3193f6434a0ad1a22;p=dotfiles.git emacs add mapping of keychord --- diff --git a/emacs.d/config/init-keychord.el b/emacs.d/config/init-keychord.el new file mode 100644 index 0000000..e15e56b --- /dev/null +++ b/emacs.d/config/init-keychord.el @@ -0,0 +1,28 @@ + + +(require 'key-chord) + +(setq key-chord-two-keys-delay 0.5) + +;; from emacs conference 2015 workshop +(defun keychord-keymap (keychord bindings) + (setq keymap (make-sparse-keymap)) + (dolist (binding bindings) + (define-key keymap (car binding) (cdr binding))) + (key-chord-define-global keychord keymap)) + +;; main keymap +(keychord-keymap "dk" + '(("f" . helm-mini) + ("a" . find-file))) + + +;; helm-mini find buffer and recent file +(key-chord-define-global "sj" 'helm-mini) +(key-chord-define-global "sk" 'helm-find-files) +;(key-chord-define-global ";s" ') + +(key-chord-define-global "jj" "\C-g") +(key-chord-mode 1) + +(provide 'init-keychord) diff --git a/emacs.d/init.el b/emacs.d/init.el index c281acc..c1e9cec 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -133,4 +133,4 @@ "eim-py" "euc-cn" 'eim-use-package "拼音" "汉字拼音输入法" "~/.emacs.d/site-lisp/eim/py.txt") - +(require 'init-keychord)