summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--attic/misc.org40
-rw-r--r--exwm.org2
-rw-r--r--init.org42
3 files changed, 43 insertions, 41 deletions
diff --git a/attic/misc.org b/attic/misc.org
index 83f969c..74b8fbc 100644
--- a/attic/misc.org
+++ b/attic/misc.org
@@ -209,3 +209,43 @@
:diminish ((rcirc-omit-mode . "")))
#+end_src
+* switch window
+ An alternative for this one is ace-window, but it has the problem
+ of not displaying its overlay over org buffers (sometimes) and
+ introducing a dependency (avy).
+ #+begin_src emacs-lisp
+ (use-package switch-window
+ :ensure t
+ :custom ((switch-window-minibuffer-shortcut ?z)
+ (switch-window-background t)
+ (switch-window-shortcut-style 'qwerty)
+ (switch-window-timeout 7)
+ (switch-window-threshold 2))
+ :init (defalias 'jao-other-window 'switch-window)
+ :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 ()
+ (interactive)
+ (jao-switch-window--then "Switch to buffer" 'consult-buffer))
+
+ :bind (("M-o" . switch-window)
+ ("M-O" . switch-window-then-swap-buffer)
+ ("H-s-o" . switch-window)
+ ("H-s-O" . switch-window-then-swap-buffer)
+ ("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)))
+ #+end_src
diff --git a/exwm.org b/exwm.org
index 092e242..dd3f67c 100644
--- a/exwm.org
+++ b/exwm.org
@@ -499,8 +499,6 @@
(define-key exwm-mode-map (kbd "C-c O") #'jao-exwm-pdf-goto-org*)
(define-key exwm-mode-map (kbd "M-o") #'other-window)
- (defalias 'jao-other-window 'switch-window)
-
(setq
exwm-input-global-keys
'(([?\s-0] . jao-afio--goto-scratch)
diff --git a/init.org b/init.org
index 11c08d4..dc8c28f 100644
--- a/init.org
+++ b/init.org
@@ -1180,8 +1180,11 @@
(dotimes (x n) (other-window 1)))
(jao-minibuffer-refresh))
+ (defalias 'jao-other-window 'other-window)
+
(global-set-key (kbd "s-a") #'jao-first-window)
(global-set-key (kbd "H-s-a") #'jao-first-window)
+ (global-set-key (kbd "C-x o") 'jao-other-window)
(global-set-key (kbd "C-x p") 'jao-prev-window)
(global-set-key (kbd "C-c 0") #'jao-first-window)
@@ -1190,45 +1193,6 @@
`(lambda () (interactive) (jao--nth-window ,n))))
#+end_src
-*** Switch window
- An alternative for this one is ace-window, but it has the problem
- of not displaying its overlay over org buffers (sometimes) and
- introducing a dependency (avy).
- #+begin_src emacs-lisp
- (use-package switch-window
- :ensure t
- :custom ((switch-window-minibuffer-shortcut ?z)
- (switch-window-background t)
- (switch-window-shortcut-style 'qwerty)
- (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 ()
- (interactive)
- (jao-switch-window--then "Switch to buffer" 'consult-buffer))
-
- :bind (("M-o" . switch-window)
- ("M-O" . switch-window-then-swap-buffer)
- ("H-s-o" . switch-window)
- ("H-s-O" . switch-window-then-swap-buffer)
- ("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)))
- #+end_src
*** winner mode
#+begin_src emacs-lisp
(winner-mode 1)