diff --git a/modules/config/default/+emacs.el b/modules/config/default/+emacs.el index c9188f3d5..40c41b697 100644 --- a/modules/config/default/+emacs.el +++ b/modules/config/default/+emacs.el @@ -20,11 +20,6 @@ (advice-add #'doom/escape :before #'doom*quit-expand-region)) -(def-package! winum - :after-call (doom-switch-window-hook) - :config (winum-mode +1)) - - ;; ;;; Keybinds diff --git a/modules/config/default/packages.el b/modules/config/default/packages.el index e5f0641cc..fae1b35ed 100644 --- a/modules/config/default/packages.el +++ b/modules/config/default/packages.el @@ -5,5 +5,4 @@ (package! ace-link) (unless (featurep! :editor evil) - (package! winum) (package! expand-region)) diff --git a/modules/ui/window-select/README.org b/modules/ui/window-select/README.org index f7e6be641..34f5347b8 100644 --- a/modules/ui/window-select/README.org +++ b/modules/ui/window-select/README.org @@ -14,29 +14,33 @@ - [[#switch-window][switch-window]] * Description -This module provides the user with a visual way to switch windows. By default, -the module only kicks in if there are more than two windows open at the same -time. +This module provides several methods for selecting windows without the use of +the mouse or spatial navigation (e.g. =C-w {h,j,k,l}=). The command +~other-window~ is remapped to either ~switch-window~ or ~ace-window~, depending +on which backend you've enabled. + +#+begin_quote +~other-window~ is bound to ~C-x o~ and ~SPC w o~. +#+end_quote + +It also provides numbered windows and selection with the ~winum~ package, if +desired. Evil users can jump to window N in =C-w = (where N is a number +between 0 and 9). Non evil users have =C-x w = instead. ** Module Flags -+ =+switch-window= Use the switch-window package as the backend. -+ =+ace-window= Use avy (i.e. ace-window) as the backend. - -If neither flag is specified, ~+ace-window~ is implied. ++ =+switch-window= Use the switch-window package as the backend, instead of + ace-window (avy). ++ =+numbers= Enable numbered windows and window selection (using winum). ** Packages -+ switch-window (if =+switch-window=) -+ ace-window (if =+ace-window= or no flags) ++ [[https://github.com/dimitri/switch-window][switch-window]] (if =+switch-window=) ++ [[https://github.com/abo-abo/ace-window][ace-window]] (if =+switch-window= isn't enabled) ++ [[https://github.com/deb0ch/emacs-winum][winum]] (if =+numbers=) * Prerequisites This module has no additional dependencies. -* Features -This module remaps the function ~other-window~ to either ~switch-window~ or -~ace-window~, depending on which backend you've enabled. - -~other-window~ is bound to ~C-x o~ and ~SPC w o~. - +* TODO Features * Configuration This module provides two backends, both providing the same functionality, but with different visual cues. They are =ace-window= and =switch-window=. diff --git a/modules/ui/window-select/config.el b/modules/ui/window-select/config.el index 3bc5c032c..cb10de02e 100644 --- a/modules/ui/window-select/config.el +++ b/modules/ui/window-select/config.el @@ -19,3 +19,21 @@ (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l) aw-scope 'frame aw-background t)) + + +(def-package! winum + :when (featurep! +numbers) + :after-call (doom-switch-window-hook) + :config + (winum-mode +1) + (map! :map evil-window-map + "0" #'winum-select-window-0-or-10 + "1" #'winum-select-window-1 + "2" #'winum-select-window-2 + "3" #'winum-select-window-3 + "4" #'winum-select-window-4 + "5" #'winum-select-window-5 + "6" #'winum-select-window-6 + "7" #'winum-select-window-7 + "8" #'winum-select-window-8 + "9" #'winum-select-window-9)) diff --git a/modules/ui/window-select/packages.el b/modules/ui/window-select/packages.el index 30a4d7a92..aa9659347 100644 --- a/modules/ui/window-select/packages.el +++ b/modules/ui/window-select/packages.el @@ -1,12 +1,9 @@ ;; -*- no-byte-compile: t; -*- ;;; ui/window-select/packages.el -(cond ((featurep! +switch-window) - ;; Install switch-window if the user indicated the '+switch-window' - ;; module flag - (package! switch-window)) - ((or (featurep! +ace-window) t) - ;; Install ace-window if the user selects the flag '+ace-window' or by - ;; default ... if the user did not specify a module flag - (package! ace-window))) +(if (featurep! +switch-window) + (package! switch-window) + (package! ace-window)) +(when (featurep! +numbers) + (package! winum))