Created
March 3, 2021 22:45
-
-
Save travitch/c6fe833d313840897066ff0d925a54af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-package hydra | |
:config | |
(defhydra hydra-zoom () | |
"zoom" | |
("+" text-scale-increase "in") | |
("-" text-scale-decrease "out") | |
("0" (text-scale-adjust 0) "reset") | |
("q" nil "quit" :color red)) | |
(defhydra hydra-move () | |
"move" | |
("n" next-line "next-line") | |
("p" previous-line "prev-line") | |
("f" forward-char "next-char") | |
("b" backward-char "prev-char") | |
("s" forward-word "next-word") | |
("r" backward-word "prev-word") | |
("a" beginning-of-line "home") | |
("e" move-end-of-line "end") | |
("m" tr/forward-midpoint "next-mid") | |
("M" tr/backward-midpoint "prev-mid") | |
("v" scroll-up-command "up") | |
;; Converting M-v to V here by analogy. | |
("V" scroll-down-command "down") | |
("w" copy-region-as-kill "copy") | |
("W" kill-region "kill") | |
;; ("l" recenter-top-bottom) | |
("q" nil "quit" :color red)) | |
(defun hydra-mark () | |
"A wrapper around hydra-move that sets the mark" | |
(interactive) | |
(set-mark (point)) | |
(hydra-move/body)) | |
(global-set-key (kbd "C--") #'hydra-zoom/body) | |
(global-set-key (kbd "C-+") #'hydra-zoom/body) | |
(global-set-key (kbd "C-<SPC>") #'hydra-mark) | |
(global-set-key (kbd "C-c C-m") #'hydra-move/body) | |
(global-set-key (kbd "C-c m") #'hydra-move/body)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment