2025-12-22 10:51:46 +11:00
|
|
|
;; -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
|
|
(use-package hydra
|
|
|
|
|
:hook ((emacs-lisp-mode . hydra-add-imenu)))
|
|
|
|
|
|
|
|
|
|
(use-package pretty-hydra
|
2026-04-02 19:21:30 +11:00
|
|
|
:ensure (:wait t)
|
2025-12-22 10:51:46 +11:00
|
|
|
:hook (emacs-lisp-mode . (lambda ()
|
|
|
|
|
(add-to-list
|
|
|
|
|
'imenu-generic-expression
|
|
|
|
|
'("Hydras"
|
|
|
|
|
"^.*(\\(pretty-hydra-define\\) \\([a-zA-Z-]+\\)"
|
|
|
|
|
2))))
|
|
|
|
|
:bind ("<f6>" . toggle-hydras/body)
|
|
|
|
|
:init
|
|
|
|
|
(with-no-warnings
|
|
|
|
|
(pretty-hydra-define toggle-hydras (:color amaranth :quit-key ("q" "C-g"))
|
|
|
|
|
("Basic"
|
|
|
|
|
(("n" (cond ((fboundp 'display-line-numbers-mode)
|
|
|
|
|
(display-line-numbers-mode (if display-line-numbers-mode -1 1)))
|
|
|
|
|
((fboundp 'gblobal-linum-mode)
|
|
|
|
|
(global-linum-mode (if global-linum-mode -1 1))))
|
|
|
|
|
"line number"
|
|
|
|
|
:toggle (or (bound-and-true-p display-line-numbers-mode)
|
|
|
|
|
(bound-and-true-p global-linum-mode)))
|
|
|
|
|
("e" electric-pair-mode "electric pair" :toggle t)
|
|
|
|
|
("c" flyspell-mode "spell check" :toggle t)
|
|
|
|
|
("s" prettify-symbols-mode "pretty symbol" :toggle t)
|
|
|
|
|
("l" global-page-break-lines-mode "page break lines" :toggle t)
|
|
|
|
|
("b" display-battery-mode "battery" :toggle t)
|
|
|
|
|
("i" display-time-mode "time" :toggle t)
|
|
|
|
|
("m" doom-modeline-mode "modern mode-line" :toggle t))
|
|
|
|
|
"Highlight"
|
|
|
|
|
(("h l" global-hl-line-mode "line" :toggle t)
|
|
|
|
|
("h p" show-paren-mode "paren" :toggle t)
|
|
|
|
|
("h w" (setq-default show-trailing-whitespace (not show-trailing-whitespace))
|
|
|
|
|
"whitespace" :toggle show-trailing-whitespace)
|
|
|
|
|
("h d" rainbow-delimiters-mode "delimiter" :toggle t)
|
|
|
|
|
("h t" global-hl-todo-mode "todo" :toggle t))
|
|
|
|
|
"Program"
|
2025-12-22 19:52:11 +11:00
|
|
|
(("f" global-flycheck-mode "flycheck" :toggle t)
|
2025-12-22 10:51:46 +11:00
|
|
|
("O" hs-minor-mode "hideshow" :toggle t)
|
|
|
|
|
("u" subword-mode "subword" :toggle t)
|
|
|
|
|
("W" which-function-mode "which function" :toggle t)
|
|
|
|
|
("E" toggle-debug-on-error "debug on error" :toggle (default-value 'debug-on-error))
|
|
|
|
|
("Q" toggle-debug-on-quit "debug on quit" :toggle (default-value 'debug-on-quit))
|
|
|
|
|
("v" global-diff-hl-mode "gutter" :toggle t)
|
|
|
|
|
("V" diff-hl-flydiff-mode "live gutter" :toggle t)
|
|
|
|
|
("M" diff-hl-margin-mode "margin gutter" :toggle t)
|
|
|
|
|
("D" diff-hl-dired-mode "dired gutter" :toggle t))
|
|
|
|
|
))))
|
|
|
|
|
|
|
|
|
|
(provide 'init-hydra)
|
|
|
|
|
|