]> code.delx.au - gnu-emacs-elpa/blob - packages/ace-window/README.md
Add 'packages/ace-window/' from commit '2580bf9bd7f66ed4e923a125ee8efcc4b6a043e0'
[gnu-emacs-elpa] / packages / ace-window / README.md
1 # ace-window
2
3 **GNU Emacs package for selecting a window to switch to**
4
5 ## What and why
6
7 I'm sure you're aware of `other-window` command. While it's great for
8 two windows, it quickly loses it's value when there are more windows:
9 you need to call it many times, and since it's not easily predictable,
10 you have to check each time if you're in the window that you wanted.
11
12 Another approach is to use `windmove-left`, `windmove-up` etc. These
13 are fast and predictable. Their disadvantage is that they need 4 key
14 bindings. The default ones are shift+arrows, which are hard to reach.
15
16 This package aims to take the speed and predictability of `windmove`
17 and pack it into a single key binding, similar to `other-window`.
18
19 ## Setup
20
21 Just assign `ace-window` to a short key binding, as switching windows
22 is a common task. I suggest <kbd>M-p</kbd>, as it's short and not
23 bound in the default Emacs.
24
25 ## Usage
26
27 When there are two windows, `ace-window` will call `other-window`. If
28 there are more, each window will have its first character highlighted.
29 Pressing that character will switch to that window. Note that, unlike
30 `ace-jump-mode`, the point position will not be changed: it's the same
31 behavior as that of `other-window`.
32
33 The windows are ordered top-down, left-to-right. This means that if
34 you remember your window layouts, you can switch windows without even
35 looking at the leading char. For instance, the top left window will
36 always be `1`.
37
38 `ace-window` works across multiple frames, as you can see from the
39 [in-action gif](http://oremacs.com/download/ace-window.gif).
40
41 ## Swap and delete window
42
43 - You can swap windows by calling `ace-window` with a prefix argument <kbd>C-u</kbd>.
44
45 - You can delete the selected window by calling `ace-window` with a double prefix argument, i.e. <kbd>C-u C-u</kbd>.
46
47 ## Customization
48 Aside from binding `ace-window`:
49
50 (global-set-key (kbd "M-p") 'ace-window)
51
52 maybe you'd like the following customizations:
53
54 ### `aw-keys`
55 `aw-keys` - the sequence of leading characters for each window:
56
57 (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))
58
59 `aw-keys` are 0-9 by default, which is reasonable, but in the setup
60 above, the keys are on the home row.
61
62 ### `aw-scope`
63 The default one is `global`, which means that `ace-window` will work
64 across frames. If you set this to `frame`, `ace-window` will offer you
65 the windows only on current frame.
66
67 ### `aw-background`
68
69 By default, `ace-window` temporarily sets a gray background and
70 removes color from available windows in order to make the
71 window-switching characters more visible. This is the behavior
72 inherited from `ace-jump-mode`.
73
74 This behavior might not be necessary, as you already know the locations
75 where to look, i.e. the top-left corners of each window.
76 So you can turn off the gray background with:
77
78 (setq aw-background nil)