blob: 84d94be5592d65cc142c66884c6a6ac90681a746 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
;;; evil-org-mode.el --- evil keybindings for org-mode
;; Copyright (C) 2012-2013 by Edward Tjörnhammar
;; Author: Edward Tjörnhammar
;; URL: https://github.com/edwtjo/evil-org-mode.git
;; Git-Repository; git://github.com/edwtjo/evil-org-mode.git
;; Created: 2012-06-14
;; Version: 0.1.0
;; Package-Requires: ((evil "0"))
;; Keywords: evil vim-emulation org-mode key-bindings presets
;; This file is not part of GNU Emacs
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;; Known Bugs:
;; See, https://github.com/edwtjo/evil-org-mode/issues
(require 'evil)
;; (require 'evil-leader)
(require 'org)
(define-minor-mode evil-org-mode
"Buffer local minor mode for evil-org"
:init-value nil
:lighter " EvilOrg"
:keymap (make-sparse-keymap) ; defines evil-org-mode-map
:group 'evil-org)
(add-hook 'org-mode-hook 'evil-org-mode) ;; only load with org-mode
;; regular normal state shortcuts.
(evil-define-key 'normal evil-org-mode-map
"gh" 'outline-up-heading
"gj" 'org-forward-same-level
"gk" 'org-backward-same-level
"gl" 'outline-next-visible-heading
"H" 'org-beginning-of-line
"L" 'org-end-of-line
"t" 'org-todo
"$" 'org-end-of-line
"^" 'org-beginning-of-line
"-" 'org-ctrl-c-minus
"<" 'org-metaleft
">" 'org-metaright)
;; leader shortcuts in normal state. (disabled for now)
;; (evil-leader/set-key 'normal evil-org-mode-map
;; "c" 'org-cycle
;; "e" 'org-export-dispatch
;; "n" 'outline-next-visible-heading
;; "p" 'outline-previous-visible-heading
;; "t" 'org-set-tags-command
;; "u" 'outline-up-heading)
;; normal & insert state shortcuts.
(mapcar (lambda (state)
(evil-define-key state evil-org-mode-map
(kbd "M-l") 'org-metaright
(kbd "M-h") 'org-metaleft
(kbd "M-k") 'org-metaup
(kbd "M-j") 'org-metadown
(kbd "M-L") 'org-shiftmetaright
(kbd "M-H") 'org-shiftmetaleft
(kbd "M-K") 'org-shiftmetaup
(kbd "M-J") 'org-shiftmetadown)) '(normal insert))
(provide 'evil-org)
;;; evil-org-mode.el ends here
|