summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--init.org22
1 files changed, 22 insertions, 0 deletions
diff --git a/init.org b/init.org
index 57927bb..cb97d95 100644
--- a/init.org
+++ b/init.org
@@ -1260,6 +1260,7 @@
#+begin_src emacs-lisp
(use-package ace-window
:ensure t
+ :demand t
:init (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
aw-char-position 'top-left
aw-ignore-current nil
@@ -1270,6 +1271,27 @@
:bind (("M-o" . ace-window)
("M-O" . ace-swap-window)
("C-x p" . ace-window)))
+
+ (defun jao-ace-switch-buffer-other-window ()
+ (interactive)
+ (aw-select "Other window"
+ (if (eq jao-completion-engine 'consult)
+ (lambda (w)
+ (aw-switch-to-window w)
+ (call-interactively 'consult-buffer))
+ #'aw-switch-buffer-in-window)))
+
+ (defun jao-ace-find-file-other-window ()
+ (interactive)
+ (aw-select "Other window"
+ (lambda (w)
+ (let ((df default-directory))
+ (aw-switch-to-window w)
+ (let ((default-directory df))
+ (call-interactively 'find-file))))))
+
+ (global-set-key (kbd "C-x 4 f") #'jao-ace-find-file-other-window)
+ (global-set-key (kbd "C-x 4 b") #'jao-ace-switch-buffer-other-window)
#+end_src
*** first window and transient other window
#+begin_src emacs-lisp