From 8bb3fa49d2baa18c2dee5db33a7400899834a589 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sat, 17 Jun 2017 17:46:02 +0100 Subject: [PATCH] Emacs: Evil: Match org-mode's hjkl bindings with arrow keys --- .emacs.d/lisp/tool-evil.el | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.emacs.d/lisp/tool-evil.el b/.emacs.d/lisp/tool-evil.el index b7ea961a..da7c1fc4 100644 --- a/.emacs.d/lisp/tool-evil.el +++ b/.emacs.d/lisp/tool-evil.el @@ -21,8 +21,8 @@ ;; The evil-leader package might seem worthless but it centralizes the leader ;; key configuration and automatically makes it available in relevant states. -;; We do not map to most used command since it could be -;; misleading. Maybe the helm buffer menu would be interesting to have though? +;; Should we map to the most used command, e.g. `helm-mini'? +;; Could be misleading. (when (require 'evil-leader nil t) ;; Leader mode and its key must be set before evil-mode. (evil-leader/set-leader "") @@ -159,10 +159,14 @@ See `eshell' for the numeric prefix arg." (evil-leader/set-key-for-mode 'org-mode "a" 'org-agenda)) (evil-define-key 'normal org-mode-map (kbd "M-") (lambda () (interactive) (evil-insert 1) (org-meta-return)) - "\M-l" 'org-shiftright - "\M-h" 'org-shiftleft - "\M-k" 'org-shiftup - "\M-j" 'org-shiftdown + "L" 'org-shiftright + "H" 'org-shiftleft + "K" 'org-shiftup + "J" 'org-shiftdown + "\M-l" 'org-metaright + "\M-h" 'org-metaleft + "\M-k" 'org-metaup + "\M-j" 'org-metadown "\M-L" 'org-shiftmetaright "\M-H" 'org-shiftmetaleft "\M-K" 'org-shiftmetaup @@ -210,11 +214,6 @@ See `eshell' for the numeric prefix arg." ;; TODO: When point is on "> ", helm-find-files looks up parent folder. Prevent that. -;; DONE: eshell-mode-map gets reset on new shells. Make it permanent. Hook? Hook looks good: -;; https://stackoverflow.com/questions/11946113/emacs-eshell-how-to-read-content-of-command-line-on-pressing-ret - -;; DONE: Cannot kill emacs when eshell has started: "text is read only" - ;; TODO: Make Evil commands react more dynamically with read-only text. ;; Add support for I, C, D, S, s, c*, d*, R, r. ;; See https://github.com/emacs-evil/evil/issues/852