diff options
| author | jao <jao@gnu.org> | 2026-11-07 00:29:49 +0000 |
|---|---|---|
| committer | jao <jao@gnu.org> | 2026-11-07 00:29:49 +0000 |
| commit | f493ea864097c357b46672bf1132a30184ce1e62 (patch) | |
| tree | 4084cb2eb72e0cbd041cf215875ad1d91bcc331a | |
| parent | e9f11c2534cc41bd5a433f625aa1d73a2aa23fcd (diff) | |
| download | elibs-f493ea864097c357b46672bf1132a30184ce1e62.tar.gz elibs-f493ea864097c357b46672bf1132a30184ce1e62.tar.bz2 | |
switch in lieu of spatial -windowmain
| -rw-r--r-- | attic/elisp/misc.el | 41 | ||||
| -rw-r--r-- | init.el | 43 |
2 files changed, 41 insertions, 43 deletions
diff --git a/attic/elisp/misc.el b/attic/elisp/misc.el index 8808a5f..e0e13a9 100644 --- a/attic/elisp/misc.el +++ b/attic/elisp/misc.el @@ -128,39 +128,20 @@ ("M-O" . ace-swap-window) ("C-x 4 t" . ace-swap-window))) -;;; switch window -(use-package switch-window +;;; window navigation (spatial-window) +(use-package spatial-window :ensure t - :custom ((switch-window-minibuffer-shortcut ?z) - (switch-window-background t) - (switch-window-shortcut-style 'qwerty) - (switch-window-shortcut-appearance 'text) - (switch-window-timeout 7) - (switch-window-threshold 2)) :config - (defun jao-switch-window--then (prompt cmd) - (let ((f `(lambda () - (let ((default-directory ,default-directory)) - (call-interactively ',cmd))))) - (switch-window--then prompt f f))) - - (defun jao-switch-window-then-dired () - (interactive) - (jao-switch-window--then "Find directory" 'dired)) - - (defun jao-switch-window-then-find-file () - (interactive) - (jao-switch-window--then "Find file" 'find-file)) - - (defun jao-switch-window-then-consult-buffer () + (defun jao-spatial-window-select () (interactive) - (jao-switch-window--then "Switch to buffer" 'consult-buffer)) - - :bind (("s-o" . switch-window) - ("C-x 4 d" . jao-switch-window-then-dired) - ("C-x 4 f" . jao-switch-window-then-find-file) - ("C-x 4 b" . jao-switch-window-then-consult-buffer))) - + (let ((n (length (window-list)))) + (cond ((< n 2)) + ((< n 3) (other-window 1)) + (t (spatial-window-select))))) + :bind + ("M-o" . jao-spatial-window-select) + ("C-x o" . jao-spatial-window-select) + ("C-x p" . jao-spatial-window-select)) ;;; git helpers (use-package dired-git-info :ensure t @@ -1022,22 +1022,39 @@ (global-set-key "\C-xp" 'jao-prev-window) -;;;; window navigation (spatial-window) - -(use-package spatial-window +;;;; window navigation (switch-window) +(use-package switch-window :ensure t + :custom ((switch-window-minibuffer-shortcut ?z) + (switch-window-background t) + (switch-window-shortcut-style 'qwerty) + (switch-window-input-style 'minibuffer) + (switch-window-shortcut-appearance 'text) + (switch-window-timeout 7) + (switch-window-threshold 2)) :config - (defun jao-spatial-window-select () + (defun jao-switch-window--then (prompt cmd) + (let ((f `(lambda () + (let ((default-directory ,default-directory)) + (call-interactively ',cmd))))) + (switch-window--then prompt f f))) + + (defun jao-switch-window-then-dired () + (interactive) + (jao-switch-window--then "Find directory" 'dired)) + + (defun jao-switch-window-then-find-file () (interactive) - (let ((n (length (window-list)))) - (cond ((< n 2)) - ((< n 3) (other-window 1)) - (t (spatial-window-select))))) - - :bind - ("M-o" . jao-spatial-window-select) - ("C-x o" . jao-spatial-window-select) - ("C-x p" . jao-spatial-window-select)) + (jao-switch-window--then "Find file" 'find-file)) + + (defun jao-switch-window-then-consult-buffer () + (interactive) + (jao-switch-window--then "Switch to buffer" 'consult-buffer)) + + :bind (("M-o" . switch-window) + ("C-x 4 d" . jao-switch-window-then-dired) + ("C-x 4 f" . jao-switch-window-then-find-file) + ("C-x 4 b" . jao-switch-window-then-consult-buffer))) ;;;; transposing windows (defun transpose-windows (arg) |
