File: ace-window.el.html

The main function, ace-window is meant to replace other-window by assigning each window a short, unique label. When there are only two windows present, other-window is called (unless aw-dispatch-always is set non-nil). If there are more, each window will have its first label character highlighted. Once a unique label is typed, ace-window will switch to that window.

To setup this package, just add to your .emacs:

   (global-set-key (kbd "M-o") 'ace-window)

replacing "M-o" with an appropriate shortcut.

By default, ace-window uses numbers for window labels so the window labeling is intuitively ordered. But if you prefer to type keys on your home row for quicker access, use this setting:

   (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))

Whenever ace-window prompts for a window selection, it grays out all the window characters, highlighting window labels in red. To disable this behavior, set this:

   (setq aw-background nil)

If you want to know the selection characters ahead of time, turn on ace-window-display-mode(var)/ace-window-display-mode(fun).

When prefixed with one universal-argument, instead of switching to the selected window, the selected window is swapped with the current one.

When prefixed with two universal-argument, the selected window is deleted instead.

Defined variables (32)

ace-window-display-modeNon-nil if Ace-Window-Display mode is enabled.
ace-window-display-mode-hookHook run after entering or leaving ‘ace-window-display-mode’.
ace-window-modeMinor mode during the selection process.
aw--lead-overlay-fnFunction used to display the lead chars.
aw--remove-leading-chars-fnFunction used to cleanup lead chars.
aw--window-ringHold the window switching history.
aw--windows-hscrollList of (window . hscroll-columns) items, each listing a window whose
aw--windows-pointsList of (window . point) items. The point position had to be
aw-actionFunction to call at the end of ‘aw-select’.
aw-backgroundWhen t, ‘ace-window’ will dim out all buffers temporarily when used.
aw-char-positionWindow positions of the character overlay.
aw-dispatch-alistList of actions for ‘aw-dispatch-default’.
aw-dispatch-alwaysWhen non-nil, ‘ace-window’ will issue a ‘read-char’ even for one window.
aw-dispatch-functionFunction to call when a character not in ‘aw-keys’ is pressed.
aw-dispatch-when-more-thanIf the number of windows is more than this, activate ace-window-ness.
aw-display-mode-overlayWhen nil, don’t display overlays. Rely on the mode line instead.
aw-empty-buffers-listStore the read-only empty buffers which had to be modified.
aw-fair-aspect-ratioThe aspect ratio to aim for when splitting windows.
aw-frame-offsetIncrease in pixel offset for new ace-window frames relative to the selected frame.
aw-frame-sizeFrame size to make new ace-window frames.
aw-ignore-currentWhen t, ‘ace-window’ will ignore ‘selected-window’.
aw-ignore-onWhen t, ‘ace-window’ will ignore buffers and major-modes in ‘aw-ignored-buffers’.
aw-ignored-buffersList of buffers and major-modes to ignore when choosing a window from the window list.
aw-keysKeys for selecting window.
aw-leading-char-styleStyle of the leading char overlay.
aw-make-frame-charNon-existing ace window label character that triggers creation of a new single-window frame for display.
aw-minibuffer-flagWhen non-nil, also display ‘ace-window-mode’ string in the minibuffer when ace-window is active.
aw-overlays-backHold overlays for when ‘aw-background’ is t.
aw-reverse-frame-listWhen non-nil ‘ace-window’ will order frames for selection in
aw-scopeThe scope used by ‘ace-window’.
aw-swap-invertWhen non-nil, the other of the two swapped windows gets the point.
aw-translate-char-functionFunction to translate user input key into another key.

Defined functions (43)

ace-delete-other-windows()
ace-delete-window()
ace-display-buffer(BUFFER ALIST)
ace-select-window()
ace-swap-window()
ace-window(ARG)
ace-window-display-mode(&optional ARG)
aw--after-make-frame(F)
aw--dispatch-action(CHAR)
aw--done()
aw--lead-overlay(PATH LEAF)
aw--make-backgrounds(WND-LIST)
aw--overlay-str(WND POS PATH)
aw--point-visible-p()
aw--pop-window()
aw--push-window(WINDOW)
aw--restore-windows-hscroll()
aw-clean-up-avy-current-path()
aw-copy-window(WINDOW)
aw-delete-window(WINDOW &optional KILL-BUFFER)
aw-dispatch-default(CHAR)
aw-execute-command-other-window(WINDOW)
aw-flip-window()
aw-ignored-p(WINDOW)
aw-make-frame()
aw-move-window(WINDOW)
aw-offset(WINDOW)
aw-select(MODE-LINE &optional ACTION)
aw-set-make-frame-char(OPTION VALUE)
aw-set-mode-line(STR)
aw-show-dispatch-help()
aw-split-window-fair(WINDOW)
aw-split-window-horz(WINDOW)
aw-split-window-vert(WINDOW)
aw-swap-window(WINDOW)
aw-switch-buffer-in-window(WINDOW)
aw-switch-buffer-other-window(WINDOW)
aw-switch-to-window(WINDOW)
aw-transpose-frame(W)
aw-update()
aw-use-frame(WINDOW)
aw-window-list()
aw-window<(WND1 WND2)

Defined faces (4)

aw-background-faceFace for whole window background during selection.
aw-key-faceFace used by ‘aw-show-dispatch-help’.
aw-minibuffer-leading-char-faceFace for minibuffer leading char.
aw-mode-line-faceFace used for displaying the ace window key in the mode-line.