diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-02-01 18:54:41 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-02-02 22:42:24 -0500 |
commit | 3993e88764bfe3415b0a7bff83a5ba630cf9cfe1 (patch) | |
tree | f5987e7820352f4b4f29c142a99537fa6d009626 | |
parent | 9eb55edf10df005beaef0393f3a03bddf4c116b8 (diff) | |
download | emacs.d-3993e88764bfe3415b0a7bff83a5ba630cf9cfe1.tar.gz |
Rework key chords
- Use letter pairs that are rare in both directions. For really
common commands, try to keep my fingers on home row.
- Remove some key chords for less frequent commands. For Projectile,
just bind switching projects and the commander because most other
things are available with one more key from the commander.
My strategy for key chord bindings was to lead with ',' or ';' and
then follow with any letter. The idea was that, with the languages and
coding conventions I was using at the time, when I inserted a comma or
semicolon, they were usually followed by a non-letter (typically a
space or a new line). But, this is actually not a good way to go
about this because Key chord mode accepts the two-letter combination
in either order. In practice, I didn't end up unintentionally calling
a command too often, but it did happen enough to be slightly annoying.
John Cook recently posted a table [1] of bigram frequencies, which is
a good starting point for updating my key chords.
[1]: http://www.johndcook.com/blog/2015/02/01/rare-bigrams/
-rw-r--r-- | lisp/init-ace.el | 5 | ||||
-rw-r--r-- | lisp/init-buffers.el | 4 | ||||
-rw-r--r-- | lisp/init-editing.el | 3 | ||||
-rw-r--r-- | lisp/init-external.el | 2 | ||||
-rw-r--r-- | lisp/init-files.el | 6 | ||||
-rw-r--r-- | lisp/init-git.el | 2 | ||||
-rw-r--r-- | lisp/init-ido.el | 2 | ||||
-rw-r--r-- | lisp/init-org.el | 4 | ||||
-rw-r--r-- | lisp/init-projectile.el | 10 | ||||
-rw-r--r-- | lisp/init-python.el | 2 | ||||
-rw-r--r-- | lisp/init-smex.el | 2 | ||||
-rw-r--r-- | lisp/init-view.el | 2 | ||||
-rw-r--r-- | lisp/init-yas.el | 4 |
13 files changed, 15 insertions, 33 deletions
diff --git a/lisp/init-ace.el b/lisp/init-ace.el index 42c04f2..6a7bccf 100644 --- a/lisp/init-ace.el +++ b/lisp/init-ace.el @@ -2,7 +2,7 @@ (setq ace-jump-mode-scope 'frame) -(key-chord-define-global ";a" 'ace-jump-mode) +(key-chord-define-global "jf" 'ace-jump-mode) ;;; Ace Link @@ -36,7 +36,6 @@ (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l) aw-scope 'global) -(define-key km/window-map "a" 'ace-window) -(key-chord-define-global ",w" 'ace-window) +(key-chord-define-global "jw" 'ace-window) (provide 'init-ace) diff --git a/lisp/init-buffers.el b/lisp/init-buffers.el index 73a49ac..98207d1 100644 --- a/lisp/init-buffers.el +++ b/lisp/init-buffers.el @@ -28,9 +28,7 @@ kill this buffer and the window." (global-set-key (kbd "C-x K") 'km/kill-buffer) -(key-chord-define-global ",d" 'km/save-and-kill-buffer) -(key-chord-define-global ",s" 'save-buffer) -(key-chord-define-global ",q" 'kill-this-buffer) +(key-chord-define-global "js" 'save-buffer) ;; Replace `list-buffers' with ibuffer. (global-set-key (kbd "C-x C-b") 'ibuffer) diff --git a/lisp/init-editing.el b/lisp/init-editing.el index d8709b4..ac2f937 100644 --- a/lisp/init-editing.el +++ b/lisp/init-editing.el @@ -144,7 +144,8 @@ and '<<<' mark the bounds of the narrowed region. (global-set-key (kbd "M-/") 'hippie-expand) -(key-chord-define-global ",c" 'km/toggle-line-or-region-comment) +(key-chord-define-global "jx" 'km/toggle-line-or-region-comment) +(key-chord-define-global "qp" 'fill-paragraph) (define-key ctl-x-4-map "nd" 'ni-narrow-to-defun-other-window) (define-key ctl-x-4-map "nn" 'ni-narrow-to-region-other-window) diff --git a/lisp/init-external.el b/lisp/init-external.el index 10d0142..392cae9 100644 --- a/lisp/init-external.el +++ b/lisp/init-external.el @@ -130,8 +130,6 @@ monitor setup)." (define-key km/compile-map "o" 'km/display-compilation-other-window) (define-key km/compile-map "r" 'km/recompile-current-compilation) -(key-chord-define-global ",e" 'km/recompile-current-compilation) - ;;; Diff diff --git a/lisp/init-files.el b/lisp/init-files.el index ced1373..d65993a 100644 --- a/lisp/init-files.el +++ b/lisp/init-files.el @@ -42,7 +42,7 @@ (global-set-key (kbd "C-x C-r") 'km/rename-current-buffer-file) (global-set-key (kbd "C-x F") 'km/find-file-as-root) -(key-chord-define-global ",f" 'find-file) +(key-chord-define-global "jc" 'find-file) (define-key ctl-x-4-map "v" 'view-file-other-window) @@ -67,8 +67,6 @@ entering `ch' is equivalent to `*.[ch]'.") (forward-line 4) (narrow-to-region (point) (point-max)))) -(key-chord-define-global ",z" 'rgrep) - (define-prefix-command 'km/file-search-map) (define-key km/file-map "s" 'km/file-search-map) @@ -106,7 +104,7 @@ entering `ch' is equivalent to `*.[ch]'.") (defun km/read-recent-file () (ido-completing-read "Choose recent file: " recentf-list nil t)) -(key-chord-define-global ",r" 'km/recentf-find-file) +(key-chord-define-global "jt" 'km/recentf-find-file) (define-key ctl-x-4-map "r" 'km/recentf-find-file-other-window) diff --git a/lisp/init-git.el b/lisp/init-git.el index 67f1924..be29616 100644 --- a/lisp/init-git.el +++ b/lisp/init-git.el @@ -161,7 +161,7 @@ the commit buffer. And no dinging." (define-key ctl-x-4-map "g" 'magit-find-file-other-window) (define-key km/file-map "g" 'magit-find-file) -(key-chord-define-global ",g" 'magit-status) +(key-chord-define-global "jg" 'magit-status) (after 'magit ;; Remove `magit-add-change-log-entry-other-window', which overrides diff --git a/lisp/init-ido.el b/lisp/init-ido.el index 9332081..08b9303 100644 --- a/lisp/init-ido.el +++ b/lisp/init-ido.el @@ -31,6 +31,6 @@ (ido-ubiquitous-mode) (ido-at-point-mode) -(key-chord-define-global ",b" 'ido-switch-buffer) +(key-chord-define-global "vv" 'ido-switch-buffer) (provide 'init-ido) diff --git a/lisp/init-org.el b/lisp/init-org.el index db0964c..8370664 100644 --- a/lisp/init-org.el +++ b/lisp/init-org.el @@ -355,10 +355,8 @@ displayed in the agenda." (org-agenda-text-search-extra-files :maxlevel . 3)))) (org-refile '(4)))) -(key-chord-define-global ",a" 'org-agenda) -(key-chord-define-global ",t" 'org-capture) - (define-key km/global-org-map "a" 'org-agenda) +(define-key km/global-org-map "c" 'org-capture) (define-key km/global-org-map "j" 'km/org-goto-agenda-heading) (define-key km/global-org-map "m" 'km/org-open-default-notes-file-inbox) (define-key km/global-org-map "n" 'km/org-agenda-add-or-remove-file) diff --git a/lisp/init-projectile.el b/lisp/init-projectile.el index 1c15ecd..6024ff1 100644 --- a/lisp/init-projectile.el +++ b/lisp/init-projectile.el @@ -60,14 +60,8 @@ Interactive arguments are processed according to (define-key projectile-command-map "j" 'km/projectile-switch-project-to-file) -(key-chord-define-global ";c" 'projectile-commander) -(key-chord-define-global ";d" 'projectile-find-dir) -(key-chord-define-global ";f" 'projectile-find-file) -(key-chord-define-global ";g" 'projectile-grep) -(key-chord-define-global ";r" 'projectile-recentf) -(key-chord-define-global ";s" 'projectile-switch-project) -(key-chord-define-global ";t" 'km/projectile-open-external-terminal-in-root) -(key-chord-define-global ";v" 'km/projectile-view-file) +(key-chord-define-global "jq" 'projectile-commander) +(key-chord-define-global "gp" 'projectile-switch-project) (define-prefix-command 'km/projectile-ctl-x-4-map) (define-key ctl-x-4-map "p" 'km/projectile-ctl-x-4-map) diff --git a/lisp/init-python.el b/lisp/init-python.el index 7961920..d05e71e 100644 --- a/lisp/init-python.el +++ b/lisp/init-python.el @@ -101,8 +101,6 @@ This is inspired by `ess-eval-function-or-paragraph-and-step'." n)) (after 'python - (key-chord-define python-mode-map ";w" 'auto-complete) - (define-key python-mode-map (kbd "C-c C-.") 'km/python-shell-send-buffer-up-to-line) (define-key python-mode-map (kbd "C-c C-b") 'python-shell-send-buffer) diff --git a/lisp/init-smex.el b/lisp/init-smex.el index 86d12a7..6b909d8 100644 --- a/lisp/init-smex.el +++ b/lisp/init-smex.el @@ -1,6 +1,6 @@ (global-set-key (kbd "M-X") 'smex-major-mode-commands) -(key-chord-define-global ",x" 'smex) +(key-chord-define-global "kx" 'smex) (smex-initialize) diff --git a/lisp/init-view.el b/lisp/init-view.el index 38e2c64..75ffafd 100644 --- a/lisp/init-view.el +++ b/lisp/init-view.el @@ -9,6 +9,6 @@ (define-key view-mode-map "[" 'backward-paragraph) (define-key view-mode-map "j" 'km/imenu)) -(key-chord-define-global ",v" 'view-mode) +(key-chord-define-global "hq" 'view-mode) (provide 'init-view) diff --git a/lisp/init-yas.el b/lisp/init-yas.el index 1b367e4..060f6e3 100644 --- a/lisp/init-yas.el +++ b/lisp/init-yas.el @@ -1,9 +1,7 @@ (require 'yasnippet) - -(key-chord-define-global ";e" 'yas-expand) - +(define-key yas-minor-mode-map (kbd "C-c i") 'yas-expand) (define-key yas-minor-mode-map (kbd "<tab>") nil) (define-key yas-minor-mode-map (kbd "TAB") nil) |