Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 112 lines (99 sloc) 4.199 kb
483bb56 @jgm Evil mode - set normal as default state.
authored
1 (setq evil-default-state 'normal)
aa4f416 @jgm Make SPC and DEL work in visual mode in evil.
authored
2 (defun evil-space-del (statemap)
3 (define-key statemap (kbd "SPC") (lambda ()
4 (interactive)
314869c @jgm More evil customizations.
authored
5 (evil-scroll-down nil)))
8f3caab @jgm Fixed evil-mode backspace on osx.
authored
6 (define-key statemap [backspace] (lambda ()
7 (interactive)
8 (evil-scroll-up nil)))
314869c @jgm More evil customizations.
authored
9 (define-key statemap (kbd "DEL") (lambda ()
10 (interactive)
11 (evil-scroll-up nil))))
aa4f416 @jgm Make SPC and DEL work in visual mode in evil.
authored
12 (evil-space-del evil-normal-state-map)
13 (evil-space-del evil-visual-state-map)
04f6d6a @jgm Added evil-customizations in separate file.
authored
14
314869c @jgm More evil customizations.
authored
15 (define-key evil-normal-state-map (kbd "C-n") (lambda ()
16 (interactive)
17 (evil-next-buffer)))
18 (define-key evil-normal-state-map (kbd "C-p") (lambda ()
19 (interactive)
20 (evil-prev-buffer)))
c119b5f @jgm Changed mapping for reformat-paragraph to C-\\.
authored
21 (define-key evil-normal-state-map (kbd "C-\\") (lambda ()
0736822 @jgm Added \-q for format-paragraph.
authored
22 (interactive)
23 (fill-paragraph)))
314869c @jgm More evil customizations.
authored
24
04f6d6a @jgm Added evil-customizations in separate file.
authored
25 ; make evil work for org-mode!
26 (evil-define-key 'normal org-mode-map "O" (lambda ()
27 (interactive)
28 (end-of-line)
29 (org-insert-heading)
30 (evil-append nil)
31 ))
32
33 (defun always-insert-item ()
34 (interactive)
35 (if (not (org-in-item-p))
36 (insert "\n- ")
37 (org-insert-item)))
38
39 (evil-define-key 'normal org-mode-map "O" (lambda ()
40 (interactive)
41 (end-of-line)
42 (org-insert-heading)
43 (evil-append nil)
44 ))
45 (evil-define-key 'normal org-mode-map "o" (lambda ()
46 (interactive)
47 (end-of-line)
48 (always-insert-item)
49 (evil-append nil)
50 ))
51 (evil-define-key 'normal org-mode-map "t" (lambda ()
52 (interactive)
53 (end-of-line)
54 (org-insert-todo-heading nil)
55 (evil-append nil)
56 ))
57 (evil-define-key 'normal org-mode-map (kbd "M-o") (lambda ()
58 (interactive)
59 (end-of-line)
60 (org-insert-heading)
61 (org-metaright)
62 (evil-append nil)
63 ))
64 (evil-define-key 'normal org-mode-map (kbd "M-t") (lambda ()
65 (interactive)
66 (end-of-line)
67 (org-insert-todo-heading nil)
68 (org-metaright)
69 (evil-append nil)
70 ))
71 (evil-define-key 'normal org-mode-map "T" 'org-todo) ; mark a TODO item as DONE
72 (evil-define-key 'normal org-mode-map ";a" 'org-agenda) ; access agenda buffer
73 (evil-define-key 'normal org-mode-map "-" 'org-cycle-list-bullet) ; change bullet style
74 (evil-define-key 'normal org-mode-map (kbd "TAB") 'org-cycle) ; cycle
75
76 ; allow us to access org-mode keys directly from Evil's Normal mode
77 (evil-define-key 'normal org-mode-map (kbd "M-l") 'org-metaright)
78 (evil-define-key 'normal org-mode-map (kbd "M-h") 'org-metaleft)
79 (evil-define-key 'normal org-mode-map (kbd "M-k") 'org-metaup)
80 (evil-define-key 'normal org-mode-map (kbd "M-j") 'org-metadown)
81 (evil-define-key 'normal org-mode-map (kbd "M-L") 'org-shiftmetaright)
82 (evil-define-key 'normal org-mode-map (kbd "M-H") 'org-shiftmetaleft)
83 (evil-define-key 'normal org-mode-map (kbd "M-K") 'org-shiftmetaup)
84 (evil-define-key 'normal org-mode-map (kbd "M-J") 'org-shiftmetadown)
85
13ea3ec @jgm evil: Added ZZ, :make, :cn, :cp.
authored
86 ;;; Next and previous error
87
88 (evil-ex-define-cmd "[cn]ext" 'next-error)
89 (evil-ex-define-cmd "[c]prev" 'previous-error)
90
91 ;;; Make
92
93 (evil-ex-define-cmd "make" 'compile)
94
95 ;;; ZZ
96
97 (define-key evil-normal-state-map "ZZ" 'evil-save-and-close)
98
04f6d6a @jgm Added evil-customizations in separate file.
authored
99 ;; The following will create a minor mode foo-mode with Normal
100 ;; state bindings for the keys w and e:
101 ;; (define-minor-mode foo-mode
102 ;; "Foo mode."
103 ;; :keymap (make-sparse-keymap))
104 ;; (evil-define-key ’normal foo-mode-map "w" ’bar)
105 ;; (evil-define-key ’normal foo-mode-map "e" ’baz)
106 ;; This minor mode can then be enabled in any buffers where the
107 ;; custom bindings are desired:
108 ;; (add-hook ’text-mode-hook ’foo-mode) ; enable alongside text-mode
109 ;;
110 ;; Define a command with command properties keyword-args.
111 ;; (evil-define-command command (args. . .) doc keyword-args. . . body. . .)
Something went wrong with that request. Please try again.