* .emacs.d/init.el: Add some i3-like windmove bindings.
authorAmin Bandali <bandali@kelar.org>
Sat, 7 May 2022 20:12:27 +0000 (16:12 -0400)
committerAmin Bandali <bandali@kelar.org>
Fri, 20 May 2022 02:20:01 +0000 (22:20 -0400)
.emacs.d/init.el

index 8836a1b..9c2f1ff 100644 (file)
@@ -362,6 +362,14 @@ This sets each user option VAR's value to the corresponding VALUE.
 (require 'winner)
 (winner-mode 1)
 
 (require 'winner)
 (winner-mode 1)
 
+(run-with-idle-timer 0.1 nil #'require 'windmove)
+(with-eval-after-load 'windmove
+  (csetq windmove-wrap-around t)
+  (global-set-key (kbd "M-H") #'windmove-left)
+  (global-set-key (kbd "M-L") #'windmove-right)
+  (global-set-key (kbd "M-K") #'windmove-up)
+  (global-set-key (kbd "M-J") #'windmove-down))
+
 (with-eval-after-load 'compile
   ;; don't display *compilation* buffer on success.  based on
   ;; https://stackoverflow.com/a/17788551, with changes to use `cl-letf'
 (with-eval-after-load 'compile
   ;; don't display *compilation* buffer on success.  based on
   ;; https://stackoverflow.com/a/17788551, with changes to use `cl-letf'