From 9842f1ee27c2839d082958a7d9c6b72be17dc92e Mon Sep 17 00:00:00 2001 From: jao Date: Wed, 25 Nov 2026 22:43:11 +0000 Subject: more tweaks to window switching --- init.el | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 2e75e94..78c8f17 100644 --- a/init.el +++ b/init.el @@ -980,12 +980,7 @@ (global-set-key (kbd "C-x _") #'delete-other-windows-vertically) ;;;; window navigation (custom) -(mapc (lambda (n) - (global-set-key (format "\C-c%s" (1+ n)) (jao-nth-window n))) - '(0 1 2 3 4 5 6 7 8)) - -(global-set-key "\C-xp" 'jao-prev-window) -(global-set-key (kbd "M-o") #'jao-switch-with-previous-window) +(jao-nth-window-activate) ;;;;; first window (global-set-key (kbd "s-a") #'jao-switch-with-first-window) @@ -1020,16 +1015,19 @@ (interactive) (jao-switch-window--then "Switch to buffer" 'consult-buffer)) - (advice-add 'switch-window :before #'jao-save-current-window) - - :bind (("C-M-o" . switch-window) + :bind (("M-o" . jao-switch-with-previous-window) + ("C-x p" . jao-prev-window) + ("C-M-o" . switch-window) ("C-x o" . switch-window) + ("C-x 4 0" . switch-window-then-kill-buffer) ("C-x 4 d" . jao-switch-window-then-dired) ("C-x 4 f" . jao-switch-window-then-find-file) ("C-x 4 b" . jao-switch-window-then-consult-buffer) ("C-x 4 t" . switch-window-then-swap-buffer) ("C-x 4 T" . transpose-windows))) +(jao-switch-window-activate 'switch-window) + ;;;; winner mode (winner-mode 1) -- cgit v1.2.3