summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-12-17 18:29:58 -0600
committerCase Duckworth2021-12-17 18:29:58 -0600
commit506b6c66fee75b1c5d3a94527c0f3945805ce1b8 (patch)
treeca9d24e6fb7d3278156a282b8ea93e68d7908ee7
parentLots of changes, most interestingly browse-url stuff (diff)
downloademacs-506b6c66fee75b1c5d3a94527c0f3945805ce1b8.tar.gz
emacs-506b6c66fee75b1c5d3a94527c0f3945805ce1b8.zip
Add ace-window
-rw-r--r--init.el8
-rw-r--r--lisp/+ace-window.el37
2 files changed, 45 insertions, 0 deletions
diff --git a/init.el b/init.el index 5d756cd..f8368db 100644 --- a/init.el +++ b/init.el
@@ -161,6 +161,14 @@
161 (with-eval-after-load 'embark 161 (with-eval-after-load 'embark
162 (define-key embark-region-map (kbd "U") '0x0-dwim))) 162 (define-key embark-region-map (kbd "U") '0x0-dwim)))
163 163
164(setup (:straight ace-window)
165 (:also-load +ace-window)
166 (:option aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
167 aw-display-mode-overlay nil)
168 (:+key "M-o" '+ace-window-or-switch-buffer)
169 (:face aw-mode-line-face ((t (:foreground "red"))))
170 (+ace-window-display-mode +1))
171
164(setup (:straight acme-theme) 172(setup (:straight acme-theme)
165 ;; (load-theme 'acme t) 173 ;; (load-theme 'acme t)
166 ) 174 )
diff --git a/lisp/+ace-window.el b/lisp/+ace-window.el new file mode 100644 index 0000000..fca27d9 --- /dev/null +++ b/lisp/+ace-window.el
@@ -0,0 +1,37 @@
1;;; +ace-window.el -*- lexical-binding: t; -*-
2
3;;; Code:
4
5(require 'ace-window)
6
7;;;###autoload
8(define-minor-mode +ace-window-display-mode
9 "Minor mode for updating data for `+modeline-ace-window-display'."
10 ;; This is stolen from ace-window.el but with the mode-line stuff ripped out.
11 :global t
12 (if +ace-window-display-mode
13 (progn
14 (aw-update)
15 (force-mode-line-update t)
16 (add-hook 'window-configuration-change-hook 'aw-update)
17 (add-hook 'after-make-frame-functions 'aw--after-make-frame t)
18 (advice-add 'aw--lead-overlay :override 'ignore))
19 (remove-hook 'window-configuration-change-hook 'aw-update)
20 (remove-hook 'after-make-frame-functions 'aw--after-make-frame)
21 (advice-remove 'aw--lead-overlay 'ignore)))
22
23;;;###autoload
24(defun +ace-window-or-switch-buffer (arg)
25 "Call `ace-window' with ARG if more than one window is visible.
26Switch to most recent buffer otherwise."
27 ;; cribbed from `crux-other-window-or-switch-buffer'
28 (interactive "p")
29 (if (one-window-p)
30 (switch-to-buffer nil)
31 (ace-window arg)))
32
33(defun +ace-window@disable-overlay (_fn &rest _args)
34 "ADVICE for FN `aw--lead-overlay' (and ARGS) to not show overlays.")
35
36(provide '+ace-window)
37;;; +ace-window.el ends here