From 2dcac6e7611459eb86c3496a0669543cd5d59c09 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Wed, 29 Dec 2021 09:35:39 -0800 Subject: [PATCH] Jump to newly created windows Since my fingers were good with splitting the window and jumping to the new window, I figured a little advice would make Emacs behave as I would have expected. --- ha-config.org | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ha-config.org b/ha-config.org index e8eedf1..109c893 100644 --- a/ha-config.org +++ b/ha-config.org @@ -538,6 +538,16 @@ To jump to a window even quicker, use the [[https://github.com/deb0ch/emacs-winu :config (winum-mode +1)) #+END_SRC +And when creating new windows, why isn't the new window selected? +#+BEGIN_SRC emacs-lisp + (defun jump-to-new-window (&rest _arg) + "Advice function to jump to newly spawned window." + (other-window 1)) + + (dolist (command '(split-window-below split-window-right + evil-window-split evil-window-vsplit)) + (advice-add command :after #'jump-to-new-window)) +#+END_SRC This is nice since the window numbers are always present on a Doom modeline, however, they order the window numbers /differently/ than =ace-window=. Let's see which I end up liking better. The ~0~ key/window should be always associated with a project-specific tree window: