emacs-winum icon indicating copy to clipboard operation
emacs-winum copied to clipboard

Feature Request: auto-switch without query when only 2 windows are open

Open WorldsEndless opened this issue 5 years ago • 1 comments

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.

WorldsEndless avatar May 26 '20 20:05 WorldsEndless

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))))

WorldsEndless avatar May 28 '20 13:05 WorldsEndless