Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
WorldsEndless opened this issue May 26, 2020 · 1 comment

Comments

@WorldsEndless
Copy link

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
Copy link
Author

WorldsEndless commented May 28, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant