aboutsummaryrefslogtreecommitdiffstats
path: root/_emacs.d/personal/50-evil.el
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@gmail.com>2016-02-24 23:26:19 +0800
committerAaron LI <aaronly.me@gmail.com>2016-02-24 23:26:19 +0800
commitd2e30e18a367cfc6be02a6a5b926da621a960c37 (patch)
tree073ce4e136c801f27e4ea821b62f7ada9a5e7763 /_emacs.d/personal/50-evil.el
parent8e661bf9bc0c2b51a5aaa6f5356fb2fb584d13d6 (diff)
downloaddotfiles-d2e30e18a367cfc6be02a6a5b926da621a960c37.tar.bz2
_emacs.d/personal/50-evil.el: add more custom keybindings
Diffstat (limited to '_emacs.d/personal/50-evil.el')
-rw-r--r--_emacs.d/personal/50-evil.el34
1 files changed, 33 insertions, 1 deletions
diff --git a/_emacs.d/personal/50-evil.el b/_emacs.d/personal/50-evil.el
index 503efc8..860fbbf 100644
--- a/_emacs.d/personal/50-evil.el
+++ b/_emacs.d/personal/50-evil.el
@@ -4,7 +4,8 @@
;; vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=lisp:
;;
;; Credit:
-;; [1] http://stackoverflow.com/a/10166400
+;; [1] https://github.com/redguardtoo/emacs.d - lisp/init-evil.el
+;; [2] http://stackoverflow.com/a/10166400
;;
;; Aaron LI
;; 2016-02-21
@@ -23,12 +24,43 @@
(define-key minibuffer-local-isearch-map [escape] 'minibuffer-keyboard-quit)
(global-set-key [escape] 'keyboard-quit)
+;; Prefer Emacs way after pressing ":" in evil-mode
+(define-key evil-ex-completion-map (kbd "C-a") 'move-beginning-of-line)
+(define-key evil-ex-completion-map (kbd "C-b") 'backward-char)
+(define-key evil-ex-completion-map (kbd "M-p") 'previous-complete-history-element)
+(define-key evil-ex-completion-map (kbd "M-n") 'next-complete-history-element)
+
+;; Evil keybindings for `org-mode'
+;; As a general RULE, mode specific evil leader keys started with
+;; uppercased character or 'g' or special character except "=" and "-"
+(evil-declare-key 'normal org-mode-map
+ "gh" 'outline-up-heading
+ "gl" 'outline-next-visible-heading
+ "S" 'org-store-link
+ "A" 'org-agenda
+ "H" 'org-beginning-of-line ; smarter behaviour on headlines etc.
+ "L" 'org-end-of-line ; smarter behaviour on headlines etc.
+ "$" 'org-end-of-line ; smarter behaviour on headlines etc.
+ "^" 'org-beginning-of-line ; ditto
+ "<" 'org-metaleft ; out-dent
+ ">" 'org-metaright ; indent
+ (kbd "TAB") 'org-cycle)
+
;; evil-leader
;; https://github.com/cofi/evil-leader
(prelude-require-package 'evil-leader)
(require 'evil-leader)
(global-evil-leader-mode)
(evil-leader/set-leader ",")
+(evil-leader/set-key
+ ;; {{{ only usable in GUI
+ "=" 'increase-default-font-height
+ "-" 'decrease-default-font-height
+ ;; }}}
+ "bf" 'buffer-menu
+ "mu" 'mu4e
+ "rm" 'remember
+)
;; evil-matchit: jump between matched tags in Emacs
;; https://github.com/redguardtoo/evil-matchit