summaryrefslogtreecommitdiffhomepage
path: root/attic
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-05-24 00:07:39 +0100
committerjao <jao@gnu.org>2021-05-24 00:07:39 +0100
commit93fe89eadedb361a659ff6e0d890588369b2044a (patch)
tree3f857f3a942dee02e3c930bf9c15e7c03fb27d03 /attic
parent170657ac85332712bd0df78e38f2d254320f3664 (diff)
downloadelibs-93fe89eadedb361a659ff6e0d890588369b2044a.tar.gz
elibs-93fe89eadedb361a659ff6e0d890588369b2044a.tar.bz2
unused stuff
Diffstat (limited to 'attic')
-rw-r--r--attic/misc.org40
1 files changed, 40 insertions, 0 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