Autoload defhydras & use new naming convention

Phasing out the +module@name convention for plain old
+module-name-hydra, which is more compatible with elisp reflection tools
like describe-function and such.

Also, Emacs starts up faster now. Tee hee.
This commit is contained in:
Henrik Lissner 2018-06-26 01:42:35 +02:00
parent 3134df8f43
commit 017ba8d79c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
10 changed files with 178 additions and 181 deletions

View file

@ -34,4 +34,47 @@
(goto-char (1+ res))
(widget-button-press (point)))))
;;;###autoload (autoload '+ein-hydra/body "tools/ein/autoload" nil nil)
(defhydra +ein-hydra (:hint t :color red)
"
Operations on Cells^^^^^^ Other
----------------------------^^^^^^ ----------------------------------^^^^
[_k_/_j_]^^ select prev/next [_t_]^^ toggle output
[_K_/_J_]^^ move up/down [_C-l_/_C-S-l_] clear/clear all output
[_C-k_/_C-j_]^^ merge above/below [_C-o_]^^ open console
[_O_/_o_]^^ insert above/below [_C-s_/_C-r_] save/rename notebook
[_y_/_p_/_d_] copy/paste [_x_]^^ close notebook
[_u_]^^^^ change type [_q_]^^ quit
[_RET_]^^^^ execute
"
("q" nil :exit t)
("h" ein:notebook-worksheet-open-prev-or-last)
("j" ein:worksheet-goto-next-input)
("k" ein:worksheet-goto-prev-input)
("l" ein:notebook-worksheet-open-next-or-first)
("H" ein:notebook-worksheet-move-prev)
("J" ein:worksheet-move-cell-down)
("K" ein:worksheet-move-cell-up)
("L" ein:notebook-worksheet-move-next)
("t" ein:worksheet-toggle-output)
("d" ein:worksheet-kill-cell)
("R" ein:worksheet-rename-sheet)
("y" ein:worksheet-copy-cell)
("p" ein:worksheet-yank-cell)
("o" ein:worksheet-insert-cell-below)
("O" ein:worksheet-insert-cell-above)
("u" ein:worksheet-change-cell-type)
("RET" ein:worksheet-execute-cell-and-goto-next)
;; Output
("C-l" ein:worksheet-clear-output)
("C-S-l" ein:worksheet-clear-all-output)
;;Console
("C-o" ein:console-open :exit t)
;; Merge and split cells
("C-k" ein:worksheet-merge-cell)
("C-j" spacemacs/ein:worksheet-merge-cell-next)
("s" ein:worksheet-split-cell-at-point)
;; Notebook
("C-s" ein:notebook-save-notebook-command)
("C-r" ein:notebook-rename-command)
("x" ein:notebook-close :exit t))

View file

@ -40,49 +40,4 @@
;; Ace-link on notebook list buffers
(after! ein-notebooklist
(define-key ein:notebooklist-mode-map "o" #'+ein/ace-link-ein))
;; add hydra
(defhydra +ein/hydra (:hint t :color red)
"
Operations on Cells^^^^^^ Other
----------------------------^^^^^^ ----------------------------------^^^^
[_k_/_j_]^^ select prev/next [_t_]^^ toggle output
[_K_/_J_]^^ move up/down [_C-l_/_C-S-l_] clear/clear all output
[_C-k_/_C-j_]^^ merge above/below [_C-o_]^^ open console
[_O_/_o_]^^ insert above/below [_C-s_/_C-r_] save/rename notebook
[_y_/_p_/_d_] copy/paste [_x_]^^ close notebook
[_u_]^^^^ change type [_q_]^^ quit
[_RET_]^^^^ execute
"
("q" nil :exit t)
("h" ein:notebook-worksheet-open-prev-or-last)
("j" ein:worksheet-goto-next-input)
("k" ein:worksheet-goto-prev-input)
("l" ein:notebook-worksheet-open-next-or-first)
("H" ein:notebook-worksheet-move-prev)
("J" ein:worksheet-move-cell-down)
("K" ein:worksheet-move-cell-up)
("L" ein:notebook-worksheet-move-next)
("t" ein:worksheet-toggle-output)
("d" ein:worksheet-kill-cell)
("R" ein:worksheet-rename-sheet)
("y" ein:worksheet-copy-cell)
("p" ein:worksheet-yank-cell)
("o" ein:worksheet-insert-cell-below)
("O" ein:worksheet-insert-cell-above)
("u" ein:worksheet-change-cell-type)
("RET" ein:worksheet-execute-cell-and-goto-next)
;; Output
("C-l" ein:worksheet-clear-output)
("C-S-l" ein:worksheet-clear-all-output)
;;Console
("C-o" ein:console-open :exit t)
;; Merge and split cells
("C-k" ein:worksheet-merge-cell)
("C-j" spacemacs/ein:worksheet-merge-cell-next)
("s" ein:worksheet-split-cell-at-point)
;; Notebook
("C-s" ein:notebook-save-notebook-command)
("C-r" ein:notebook-rename-command)
("x" ein:notebook-close :exit t)))
(define-key ein:notebooklist-mode-map "o" #'+ein/ace-link-ein)))

View file

@ -0,0 +1,13 @@
;;; tools/rgb/autoload.el -*- lexical-binding: t; -*-
;;;###autoload (autoload '+rgb-kurecolor-hydra/body "tools/rgb/autoload" nil nil)
(defhydra +rgb-kurecolor-hydra (:color pink :hint nil)
"
Inc/Dec _w_/_W_ brightness _d_/_D_ saturation _e_/_E_ hue "
("w" kurecolor-decrease-brightness-by-step)
("W" kurecolor-increase-brightness-by-step)
("d" kurecolor-decrease-saturation-by-step)
("D" kurecolor-increase-saturation-by-step)
("e" kurecolor-decrease-hue-by-step)
("E" kurecolor-increase-hue-by-step)
("q" nil "cancel" :color blue))

View file

@ -1,19 +0,0 @@
;;; tools/rgb/config.el -*- lexical-binding: t; -*-
;;
;; Plugins
;;
(def-package! kurecolor
:after rainbow-mode
:config
(defhydra +rgb@kurecolor (:color pink :hint nil)
"
Inc/Dec _w_/_W_ brightness _d_/_D_ saturation _e_/_E_ hue "
("w" kurecolor-decrease-brightness-by-step)
("W" kurecolor-increase-brightness-by-step)
("d" kurecolor-decrease-saturation-by-step)
("D" kurecolor-increase-saturation-by-step)
("e" kurecolor-decrease-hue-by-step)
("E" kurecolor-increase-hue-by-step)
("q" nil "cancel" :color blue)))