pinwheel: Setup keybindings in emacs

This commit is contained in:
Alexander Heldt
2023-09-10 22:14:40 +02:00
parent 8ccc23e68e
commit 954c681596

View File

@@ -317,6 +317,44 @@ https://github.com/justbur/emacs-which-key
(marginalia-mode)) (marginalia-mode))
#+END_SRC #+END_SRC
* Keybindings
Setup prefix for keybindings.
#+BEGIN_SRC emacs-lisp
(use-package general)
(general-create-definer alex/keybindings
:keymaps '(normal insert visual emacs)
:prefix ",")
#+END_SRC
** Quick buffer save
#+BEGIN_SRC emacs-lisp
(alex/keybindings
"," '(save-buffer :save-buffer "save"))
#+END_SRC
** Cleanup whitespace
#+BEGIN_SRC emacs-lisp
(alex/keybindings
"w" '(whitespace-cleanup :which-key "whitespace cleanup"))
#+END_SRC
** Scale text
#+BEGIN_SRC emacs-lisp
(use-package hydra)
(defhydra hydra-text-scale (:timeout 4)
"scale text"
("k" text-scale-increase "in")
("j" text-scale-decrease "out")
("r" (text-scale-adjust 0) "reset")
("esc" nil "finished" :exit t))
(alex/keybindings
"t" '(:ignore t :which-key "text")
"ts" '(hydra-text-scale/body :which-key "scale text"))
#+END_SRC
* Evil * Evil
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package evil (use-package evil