aboutsummaryrefslogtreecommitdiff
path: root/.config/emacs/init.el
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2025-07-24 10:11:45 +0200
committerMiquel Sabaté Solà <mikisabate@gmail.com>2025-07-24 10:11:45 +0200
commit1de08f0988f7c1dcf1307391c6f88f6c97b63fac (patch)
tree942453494b587dbf6fa3408b1e7aa3066563bacd /.config/emacs/init.el
parent92aa461f6937205fda2de4b7f89d73a86626cbaf (diff)
downloaddotfiles-1de08f0988f7c1dcf1307391c6f88f6c97b63fac.tar.gz
dotfiles-1de08f0988f7c1dcf1307391c6f88f6c97b63fac.zip
emacs: Fix execution of my default macro key
Apparently C-2 was being interpreted as C-@. So, let's move the lambda I was using into a function, so it can be assigned to both bindings. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to '.config/emacs/init.el')
-rw-r--r--.config/emacs/init.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
index 4018538..4c2b383 100644
--- a/.config/emacs/init.el
+++ b/.config/emacs/init.el
@@ -107,6 +107,11 @@
:states '(insert normal)
"C-z" #'evil-escape))
+(defun run-q-macro (n)
+ "Run the macro stored on the 'q' key `N' times."
+ (interactive "p")
+ (evil-execute-macro n "@q"))
+
;; Sane key-binding management.
(use-package general
:after evil
@@ -117,9 +122,8 @@
:states 'normal
"C-s" #'save-buffer
"C-e" #'evil-end-of-line
- "C-2" (lambda (n)
- (interactive "p")
- (evil-execute-macro n "@q")))
+ "C-2" #'run-q-macro
+ "C-@" #'run-q-macro)
;; And being cheeky with a C-s for saving even in insert mode.
(general-define-key