Add key-chord bindings for commonly used commands

Also includes imalison:disable-keychord-around which disables keychord
around the invocation of some function. This is used with avy commands
because those often require the user to type odd key combinations that
might be used as keychords.
This commit is contained in:
Ivan Malison 2016-06-20 11:47:20 -07:00
parent 9010d3b976
commit 926f144d6a

View File

@ -2466,11 +2466,28 @@ I don't use iedit directly, but it is used by [[*emr][emr]] and I need to disabl
:config :config
(progn (progn
(use-package company-restclient))) (use-package company-restclient)))
#+END_SRC #+END_SRC
*** key-chord *** key-chord
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package key-chord) (use-package key-chord
:preface
(defun imalison:disable-keychord-around (function &rest args)
(let ((key-chord-mode-was-enabled (bound-and-true-p key-chord-mode)))
(when key-chord-mode-was-enabled
(shut-up (key-chord-mode -1)))
(condition-case err (progn (apply function args))
(error))
(when key-chord-mode-was-enabled
(shut-up (key-chord-mode 1)))))
:config
(progn
(key-chord-mode 1)
(advice-add 'imalison:avy :around 'imalison:disable-keychord-around)
(key-chord-define-global "tg" 'imalison:term-hydra/body)
(key-chord-define-global "pj" 'imalison:projectile-find-file)
(key-chord-define-global "p[" 'projectile-switch-project)
(key-chord-define-global "sd" 'imalison:do-ag)
(key-chord-define-global "jh" 'imalison:avy)))
#+END_SRC #+END_SRC
*** nodejs-repl *** nodejs-repl
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp