summaryrefslogtreecommitdiffhomepage
path: root/init.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-03-07 05:09:54 +0000
committerjao <jao@gnu.org>2021-03-07 05:09:54 +0000
commit52acd97103c7a8e98e6b6be5b1136f8b4c9a17e3 (patch)
tree9fb933310a7fafb9d124a89d8c537f3c14294f2a /init.org
parent83d796d1a23f155fe09c0c4482be2403e451989b (diff)
downloadelibs-52acd97103c7a8e98e6b6be5b1136f8b4c9a17e3.tar.gz
elibs-52acd97103c7a8e98e6b6be5b1136f8b4c9a17e3.tar.bz2
switch-window style file/buffer-other-window with ace-window
Diffstat (limited to 'init.org')
-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