summaryrefslogtreecommitdiffhomepage
path: root/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'init.el')
-rw-r--r--init.el58
1 files changed, 39 insertions, 19 deletions
diff --git a/init.el b/init.el
index 0a1219e..65832b4 100644
--- a/init.el
+++ b/init.el
@@ -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)
+ (jao-switch-window--then "Find file" 'find-file))
+
+ (defun jao-switch-window-then-consult-buffer ()
(interactive)
- (let ((n (length (window-list))))
- (cond ((< n 2))
- ((< n 3) (other-window 1))
- (t (spatial-window-select)))))
+ (jao-switch-window--then "Switch to buffer" 'consult-buffer))
- :bind
- ("M-o" . jao-spatial-window-select)
- ("C-x o" . jao-spatial-window-select)
- ("C-x p" . jao-spatial-window-select))
+ :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)
@@ -2019,14 +2036,17 @@
(transient-define-prefix jao-transient-utils ()
"Global operations."
[["Notes"
- ("n" "create new note" jao-org-notes-create)
- ("/" "open note" jao-org-notes-open)
- ("\\" "open note by tags" jao-org-notes-consult-tags)
- ("g" "ripgrep notes" jao-org-notes-consult-ripgrep)]
+ ("nn" "create new note" jao-org-notes-create)
+ ("n/" "open note" jao-org-notes-open)
+ ("n\\" "open note by tags" jao-org-notes-consult-tags)
+ ("ng" "ripgrep notes" jao-org-notes-consult-ripgrep)]
["Documents"
("dd" "go to doc" jao-select-pdf :if display-graphic-p)
("do" "open doc" jao-open-doc)
("dr" "search docs with recoll" jao-recoll-consult-docs)]
+ ["Workspaces"
+ ("e" "main" jao-exwm-firefox* :if jao-exwm-enabled-p)
+ ("g" "mail" jao-afio-goto-mail)]
["Monitors"
;; ("p" "list projects" list-projects)
;; ("p" "htop" jao-term-htop)
@@ -2040,18 +2060,18 @@
("S" "sieve" jao-sieve-manage)]
["Chats"
("c" "connect chats" jao-all-chats)
- ("i" "irc" jao-chats-irc)
+ ("i" "irc buffer" jao-chats-irc)
("M" "mastodon" jao-mastodon)
("T" "telegram rooster" jao-telega)]
["Window system" :if jao-window-system-p
("w" "set wallpaper" jao-set-wallpaper)
("W" "set radom wallpaper" jao-set-random-wallpaper)
- ("B u" (lambda ()
+ ("Bu" (lambda ()
(let ((b (jao-x11-brightness)))
(format "bright up %s" (and (string-match ".*\\((.+)\\).*" b)
(match-string 1 b)))))
jao-x11-bright-up :transient t)
- ("B d" "bright down" jao-x11-bright-down :transient t)]
+ ("Bd" "bright down" jao-x11-bright-down :transient t)]
["Utilities"
("a" "aptitude" jao-term-aptitude)
("l" "packages" jao-list-packages)