emacs-winum
emacs-winum copied to clipboard
Feature Request: auto-switch without query when only 2 windows are open
This is what Ace-Window does: if only two windows are present, don't ask which window you want to move focus to. Just go.
Here's my solution so far. It would be nice if it didn't have to press ENTER after I choose a number, but otherwise it works:
(use-package winum
:ensure t
:bind (("s-<tab>" . tsa/winum-or-switch))
:config
(winum-set-keymap-prefix (kbd "s-`"))
(winum-mode t)
(defun tsa/winum-or-switch (&optional p)
(interactive "p")
(if (= 2 winum--window-count)
(other-frame p)
(call-interactively 'winum-select-window-by-number))))