aboutsummaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2016-10-19 14:08:01 +0200
committerMiquel Sabaté Solà <msabate@suse.com>2016-10-19 14:08:01 +0200
commit7075bdf706d83116e85879de8b680b753549eac0 (patch)
treed6a5a8137ecf3ff747be4aec4e62098137a156ae /emacs
parentfcef54d06a2a1927e9ab2d21dcd6876b83873f53 (diff)
downloaddotfiles-7075bdf706d83116e85879de8b680b753549eac0.tar.gz
dotfiles-7075bdf706d83116e85879de8b680b753549eac0.zip
emacs: fixed the macro handling
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 9328174..25ecc80 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -351,11 +351,15 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(define-key minibuffer-local-must-match-map [escape] 'minibuffer-keyboard-quit)
(define-key minibuffer-local-isearch-map [escape] 'minibuffer-keyboard-quit)
- ; I store macros on the <q> register for convenience, so let's also use the
- ; <C-q> combo to execute the macro.
- ; TODO: not really working
- (define-key evil-normal-state-map (kbd "C-q")
- (lambda () (interactive) (evil-execute-macro 1 'q)))
+ ; I store macros on the <q> register for convenience, so I used to use the
+ ; <C-q> combo to execute this macro in Vim. In Emacs though, this combo is
+ ; reserved to a rather useful function, and I'd like to keep it that way. So,
+ ; now the mapping is set to <C-2> (mnemonic: where the @ symbol is). Moreover,
+ ; it's applied as many times as specified by the numeric prefix argument.
+ (define-key evil-normal-state-map (kbd "C-2")
+ (lambda (n)
+ (interactive "p")
+ (evil-execute-macro n "@q")))
; C-s: switch to normal mode and save the buffer. I know :)
(define-key evil-normal-state-map (kbd "C-s") 'save-buffer)