Add ace-window
This commit is contained in:
parent
b11adad984
commit
506b6c66fe
8
init.el
8
init.el
|
@ -161,6 +161,14 @@
|
|||
(with-eval-after-load 'embark
|
||||
(define-key embark-region-map (kbd "U") '0x0-dwim)))
|
||||
|
||||
(setup (:straight ace-window)
|
||||
(:also-load +ace-window)
|
||||
(:option aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
|
||||
aw-display-mode-overlay nil)
|
||||
(:+key "M-o" '+ace-window-or-switch-buffer)
|
||||
(:face aw-mode-line-face ((t (:foreground "red"))))
|
||||
(+ace-window-display-mode +1))
|
||||
|
||||
(setup (:straight acme-theme)
|
||||
;; (load-theme 'acme t)
|
||||
)
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
;;; +ace-window.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'ace-window)
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode +ace-window-display-mode
|
||||
"Minor mode for updating data for `+modeline-ace-window-display'."
|
||||
;; This is stolen from ace-window.el but with the mode-line stuff ripped out.
|
||||
:global t
|
||||
(if +ace-window-display-mode
|
||||
(progn
|
||||
(aw-update)
|
||||
(force-mode-line-update t)
|
||||
(add-hook 'window-configuration-change-hook 'aw-update)
|
||||
(add-hook 'after-make-frame-functions 'aw--after-make-frame t)
|
||||
(advice-add 'aw--lead-overlay :override 'ignore))
|
||||
(remove-hook 'window-configuration-change-hook 'aw-update)
|
||||
(remove-hook 'after-make-frame-functions 'aw--after-make-frame)
|
||||
(advice-remove 'aw--lead-overlay 'ignore)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +ace-window-or-switch-buffer (arg)
|
||||
"Call `ace-window' with ARG if more than one window is visible.
|
||||
Switch to most recent buffer otherwise."
|
||||
;; cribbed from `crux-other-window-or-switch-buffer'
|
||||
(interactive "p")
|
||||
(if (one-window-p)
|
||||
(switch-to-buffer nil)
|
||||
(ace-window arg)))
|
||||
|
||||
(defun +ace-window@disable-overlay (_fn &rest _args)
|
||||
"ADVICE for FN `aw--lead-overlay' (and ARGS) to not show overlays.")
|
||||
|
||||
(provide '+ace-window)
|
||||
;;; +ace-window.el ends here
|
Loading…
Reference in New Issue