-
Notifications
You must be signed in to change notification settings - Fork 2
/
init-hydra.el
153 lines (137 loc) · 5.01 KB
/
init-hydra.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
(require 'hydra)
(defun asok/set-hydra-faces ()
(set-face-attribute
'hydra-face-red nil
:foreground (face-attribute 'font-lock-constant-face :foreground))
(set-face-attribute
'hydra-face-blue nil
:foreground (face-attribute 'font-lock-string-face :foreground)))
(defadvice load-theme
(after set-hydra-faces activate)
(asok/set-hydra-faces))
(asok/set-hydra-faces)
(defhydra hydra-eval (:color blue :columns 8)
"Eval"
("e" eval-expression "expression")
("d" eval-defun "defun")
("b" eval-buffer "buffer")
("l" eval-last-sexp "last sexp")
("1" async-shell-command "shell-command"))
(defhydra hydra-projectile (:color blue :columns 8)
"Projectile"
("f" helm-projectile-find-file "find file")
("g" helm-projectile-find-file-dwim "find file dwim")
("F" helm-projectile-find-file-in-known-projects "file in projects")
("p" helm-projectile-switch-project "switch project")
("P" projectile-test-project "test")
("k" projectile-kill-buffers "kill buffers")
("a" helm-projectile-ag "ag")
("j" helm-projectile-switch-to-buffer "buffer"))
(defhydra hydra-hl (:color blue :columns 8)
"Highlight"
("s" highlight-symbol-at-point "symbol at point")
("r" highlight-regexp "regexp")
("i" highlight-indentation-mode "indentation")
("h" hi-lock-mode "toggle hi-lock-mode"))
(defhydra hydra-winner (:color red :columns 8)
"Winner"
("h" winner-undo "undo")
("l" winner-redo "redo"))
(defhydra hydra-help (:color blue :columns 8)
"Help"
("f" describe-function "function")
("F" Info-goto-emacs-command-node "goto command")
("v" describe-variable "variable")
("m" describe-mode "mode")
("@" describe-face "face")
("k" describe-key "key")
("t" describe-theme "theme")
("b" describe-bindings "bindings")
("p" describe-package "package")
("d" helm-dash "dash")
("." helm-dash-at-point "dash at point"))
(defhydra hydra-magit (:color blue :columns 8)
"Magit"
("c" magit-status "status")
("C" magit-checkout "checkout")
("v" magit-branch-manager "branch manager")
("m" magit-merge "merge")
("l" magit-log "log")
("!" magit-git-command "command")
("$" magit-process "process"))
(defhydra hydra-evil (:color blue :columns 8)
"Evil"
("n" evil-normal-state "normal")
("i" evil-insert-state "insert")
("v" evil-visual-state "visual")
("m" evil-motion-state "motion")
("SPC" evil-spc-state "spc"))
(defhydra hydra-sp (:color red :columns 8)
"Smartparens"
("h" sp-backward-slurp-sexp "backward-slurp")
("j" sp-backward-barf-sexp "backward-barf")
("k" sp-forward-barf-sexp "forward-barf")
("l" sp-forward-slurp-sexp "forward-slurp")
("s" sp-splice-sexp "forward-slurp")
("9" asok/sp-wrap-with-parenthesis "wrap (" :exit t)
("[" asok/sp-wrap-with-square-brackets "wrap [" :exit t)
("{" asok/sp-wrap-with-curly-braces "wrap {" :exit t)
("'" asok/sp-wrap-with-quotes "wrap \"" :exit t)
("n" sp-forward-sexp "forward sexp")
("p" sp-backward-sexp "backward sexp")
)
(defhydra hydra-rspec (:color blue :columns 8)
"RSpec"
("r" rspec-rerun "rerun")
("v" rspec-verify "verify")
("a" rspec-verify-all "all")
("t" rspec-toggle-spec-and-target "toggle")
("e" rspec-toggle-spec-and-target-find-example "toggle method")
("f" rspec-run-last-failed "failed")
("s" rspec-verify-single "single")
("m" rspec-verify-matching "matching")
("d" rspec-toggle-example-pendingness "pending")
("2" asok/rspec-2-split "2 split")
)
(setq asok/hydra-global-heads
'(
("0" delete-window "delete window")
("1" delete-other-windows "delete other windows")
("2" split-window-below "split horizontally")
("3" split-window-right "split vertically")
("#" server-edit "server edit")
("w" hydra-winner/body "winner")
("9" hydra-sp/body "sp")
("s" save-buffer "save")
("o" helm-global-mark-ring "global mark ring")
("k" helm-show-kill-ring "kill ring")
("m" helm-all-mark-rings "all mark rings")
("f" helm-find-files "find files")
("6" helm-top "top")
("d" ido-dired "dired")
("x" helm-M-x "M-x")
("j" asok/helm-mini "helm mini")
("." helm-resume "helm resume")
("g" hydra-engine/body "engine")
("c" hydra-magit/body "magit")
("a" ag-project "ag project")
("A" ag "ag dir")
("SPC" avy-goto-char "avy")
("8" hydra-hl/body "highlight")
("*" helm-swoop "swoop")
("p" hydra-projectile/body "projectile")
("e" hydra-eval/body "eval")
("r" hydra-rspec/body "rspec")
("R" hydra-projectile-rails/body "rails")
("h" hydra-help/body "help")
("[" hydra-evil/body "evil")
)
)
(eval
`(defhydra hydra-spawn-global (:color blue :columns 8)
"Hydra"
,@asok/hydra-global-heads))
(evil-define-key 'spc global-map (kbd "<SPC>") 'hydra-spawn-global/body)
(evil-define-key 'normal global-map (kbd "<SPC>") 'hydra-spawn-global/body)
(evil-define-key 'motion global-map (kbd "<SPC>") 'hydra-spawn-global/body)
(evil-declare-not-repeat 'hydra-spawn-global/body)