about summary refs log tree commit diff stats
path: root/.emacs.d/lisp/init-windows.el
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2022-08-18 15:03:31 +0100
committerDavid Morgan <djm_uk@protonmail.com>2022-08-18 15:03:31 +0100
commita5534623ef21b0dfccd86e9a10216f89732288d6 (patch)
tree638a789f7419b2fcead839d660b7214be098037b /.emacs.d/lisp/init-windows.el
parentfba7022e6bcb74e9b2a1eebb1675d0b959467c49 (diff)
downloaddotfiles-a5534623ef21b0dfccd86e9a10216f89732288d6.tar.gz
Use repeat for winner-undo/redo
Diffstat (limited to '.emacs.d/lisp/init-windows.el')
-rw-r--r--.emacs.d/lisp/init-windows.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/.emacs.d/lisp/init-windows.el b/.emacs.d/lisp/init-windows.el
index 8c86a54..2228572 100644
--- a/.emacs.d/lisp/init-windows.el
+++ b/.emacs.d/lisp/init-windows.el
@@ -11,7 +11,6 @@
                (other-window -1)))
   ("C-x C-M-b" . ibuffer)
   :config
-  (winner-mode +1)
   ;; From EmacsWiki
   (defun toggle-window-split ()
     (interactive)
@@ -39,6 +38,16 @@
             (if this-win-2nd (other-window 1))))))
   (define-key ctl-x-4-map "t" 'toggle-window-split))
 
+(use-package winner
+  :config
+  (winner-mode +1)
+  (defvar winner-repeat-map
+    (let ((map (make-sparse-keymap)))
+      (define-key map (kbd "<left>") #'winner-undo)
+      (define-key map (kbd "<right>") #'winner-redo)
+      map))
+  (dolist (cmd '(winner-undo winner-redo))
+    (put cmd 'repeat-map 'winner-repeat-map)))
 
 (use-package windmove
   :init (windmove-default-keybindings))