syscfg/emacs/module/module-hydra.el

52 lines
1.3 KiB
EmacsLisp

;;; module-hydra.el --- better keybindings
;;;
;;; Commentary:
;;;
;;; Setup more convenient keybindings for Emacs.
;;;
;;; Code:
(require 'module-pkg)
(require 'module-region)
(pkg/require 'hydra)
(defhydra hydra-vertical-nav (:color red)
"Vertical navigation"
("n" next-line "down")
("p" previous-line "up")
("C-n" next-line "down")
("C-p" previous-line "up")
("f" forward-paragraph "forward paragraph")
("b" backward-paragraph "backward paragraph")
("q" nil "quit" :exit t))
(defhydra hydra-expand-region (:color red :hint nil)
"
Expand/Contract region
"
("e" er/expand-region "expand")
("c" er/contract-region "contract")
("w" er/mark-word "word")
("s" er/mark-symbol "symbol")
("d" er/mark-defun "function")
("p" er/mark-inside-pairs "inside pairs")
("P" er/mark-outside-pairs "outside pairs")
("q" er/mark-inside-quotes "inside quotes")
("Q" er/mark-outside-quotes "outside quotes")
("." er/mark-text-sentence "sentence")
("h" er/mark-html-attribute "html attribute")
("t" er/mark-inner-tag "inner tag")
("T" er/mark-outer-tag "outer tag")
("u" undo "undo" :color blue)
("r" redo "redo" :color blue)
("q" nil "quit" :color blue))
(global-set-key (kbd "C-c v") 'hydra-vertical-nav/body)
(global-set-key (kbd "C-c r") 'hydra-expand-region/body)
(provide 'module-hydra)
;;; module-hydra.el ends here.