diff options
author | jao <jao@gnu.org> | 2021-03-07 05:09:54 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-03-07 05:09:54 +0000 |
commit | 52acd97103c7a8e98e6b6be5b1136f8b4c9a17e3 (patch) | |
tree | 9fb933310a7fafb9d124a89d8c537f3c14294f2a | |
parent | 83d796d1a23f155fe09c0c4482be2403e451989b (diff) | |
download | elibs-52acd97103c7a8e98e6b6be5b1136f8b4c9a17e3.tar.gz elibs-52acd97103c7a8e98e6b6be5b1136f8b4c9a17e3.tar.bz2 |
switch-window style file/buffer-other-window with ace-window
-rw-r--r-- | init.org | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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 |