/
+bindings.el
112 lines (97 loc) · 2.84 KB
/
+bindings.el
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
;;; $DOOMDIR/+bindings.el -*- lexical-binding: t; -*-
;; Unbind prefixes
(map! :nmo "r" nil
:nmo "\\" nil
:nmo "," nil)
(map! :map evil-snipe-mode-map
:nmo "S" nil
:nmo "," nil)
(map! :map evil-snipe-override-mode-map
:nmo "S" nil
:nmo "," nil)
(map! :map evil-cleverparens-mode-map
:nmo "s" nil
:nmo "S" nil
:nmo "C-\\" nil)
;; Simple sugar
(map!
:nv "S" #'save-buffer
:nv "F" #'avy-goto-char-timer
:nv "J" #'evil-scroll-down
:nv "K" #'evil-scroll-up
:nv "gx" #'browse-url
:nv "rr" #'evil-ex-nohighlight
:nv "rb" #'revert-bufferm
:nv "rc" #'lsp-workspace-restart)
;; Easier navigation
(map!
:ne "C-h" #'evil-window-left
:ne "C-l" #'evil-window-right
:ne "C-j" #'evil-window-down
:ne "C-k" #'evil-window-up
:ne "s-h" #'+workspace/switch-left
:ne "s-l" #'+workspace/switch-right
:ne "s-n" #'+workspace/new
:ne "s-w" #'+workspace/close-window-or-workspace
:ne "s-r" #'+workspace/rename)
(map! :leader
"o o" #'dired-jump
"o O" #'projectile-dired)
;; Utils
(map!
"C-c C-\\" #'evil-make)
;; Add/override treemacs keybindings
(map!
:map treemacs-mode-map
"p" #'treemacs-peek
"x" #'treemacs-collapse-parent-node
"X" #'treemacs-collapse-all-projects
"C-h" #'evil-window-left
"C-l" #'evil-window-right
"s-h" #'+workspace/switch-left
"s-l" #'+workspace/switch-right
"s-n" #'+workspace/new
"s-w" #'+workspace/close-window-or-workspace)
;; Add some sugar in smartparens mode
(map!
:map evil-cleverparens-mode-map
:nmo "s-y" #'evil-cp-yank-sexp
:nmo "s-r" #'sp-raise-sexp
:nmo "s-k" #'delete-indentation
:nmo "s-\\" #'evil-cp-copy-paste-form
:nmo "s-9" #'evil-cp-wrap-next-round
:nmo "s-[" #'evil-cp-wrap-next-square
:nmo "s-{" #'evil-cp-wrap-next-curly
:nmo "C-\\" #'evil-cp-previous-opening
:nmo "\\" #'evil-cp-next-closing)
(map! :after ranger
(:map ranger-mode-map
[escape] #'ranger-close ))
;; Add org-agenda keybindings
(map! :after evil-org-agenda
(:map evil-org-agenda-mode-map :m "S" nil)
(:map org-agenda-mode-map
"S" #'org-save-all-org-buffers
"C-h" #'evil-window-left
"C-l" #'evil-window-right
"s-h" #'+workspace/switch-left
"s-l" #'+workspace/switch-right
"s-n" #'+workspace/new
"s-w" #'+workspace/close-window-or-workspace
"s-r" #'+workspace/rename))
;; Easier window split
(map! :leader
"\\" #'evil-window-vsplit
"-" #'evil-window-split)
;; Ace window
(map! :leader "w w" #'ace-window)
;; Elfeed;
(map! :leader "e l" #'elfeed)
;; toggle LSP Doc
(map! :leader "h h" #'lsp-describe-thing-at-point)
(map! :map clojure-mode-map
:nmo "C-c C-n" #'cider-ns-refresh)
;; force ALT key to be used as meta
(cond (IS-MAC
(setq mac-option-modifier 'meta
mac-right-option-modifier 'meta)))