Update README.md with latest commands and remove "i" (duplicate)

Re #114
old-master
Bob Weiner 8 years ago committed by Oleh Krehel
parent 2f433c8700
commit d5d8f5d831
  1. 98
      README.md
  2. 3
      ace-window.el

@ -4,13 +4,13 @@
## What and why ## What and why
I'm sure you're aware of `other-window` command. While it's great for I'm sure you're aware of the `other-window` command. While it's great
two windows, it quickly loses its value when there are more windows: for two windows, it quickly loses its value when there are more windows.
you need to call it many times, and since it's not easily predictable, You need to call it many times, and since it's not easily predictable,
you have to check each time if you're in the window that you wanted. you have to check each time if you're in the window that you wanted.
Another approach is to use `windmove-left`, `windmove-up`, etc. These Another approach is to use `windmove-left`, `windmove-up`, etc. These
are fast and predictable. Their disadvantage is that they need 4 key are fast and predictable. Their disadvantage is that they need 4 key
bindings. The default ones are shift+arrows, which are hard to reach. bindings. The default ones are shift+arrows, which are hard to reach.
This package aims to take the speed and predictability of `windmove` This package aims to take the speed and predictability of `windmove`
@ -19,25 +19,28 @@ and pack it into a single key binding, similar to `other-window`.
## Setup ## Setup
Just assign `ace-window` to a short key binding, as switching windows Just assign `ace-window` to a short key binding, as switching windows
is a common task. I suggest <kbd>M-p</kbd>, as it's short and not is a common task. I suggest <kbd>M-p</kbd>, as it's short and not
bound in the default Emacs. bound in the default Emacs.
## Usage ## Usage
When there are two windows, `ace-window` will call `other-window`. If When there are two windows, `ace-window` will call `other-window`. If
there are more, each window will have its first character highlighted. there are more, each window will have the first character of its window
Pressing that character will switch to that window. Note that, unlike identifier highlighted at the upper left of the window. Pressing that
`ace-jump-mode`, the point position will not be changed: it's the same character will either switch to that window or filter to the next
behavior as that of `other-window`. character needed to select a specific window. Note that, unlike
`ace-jump-mode`, the position of point will not be changed, i.e. the
The windows are ordered top-down, left-to-right. This means that if same behavior as that of `other-window`.
you remember your window layouts, you can switch windows without even
The windows are ordered top-down, left-to-right. This means that if you
remember your window layouts, you can switch windows without even
looking at the leading char. For instance, the top left window will looking at the leading char. For instance, the top left window will
always be `1`. always be `1` (or `a` if you use letters for window characters).
`ace-window` works across multiple frames, as you can see from the `ace-window` works across multiple frames, as you can see from the
[in-action gif](http://oremacs.com/download/ace-window.gif). [in-action gif](http://oremacs.com/download/ace-window.gif).
## Swap and delete window ## Swap and delete window
- You can swap windows by calling `ace-window` with a prefix argument <kbd>C-u</kbd>. - You can swap windows by calling `ace-window` with a prefix argument <kbd>C-u</kbd>.
@ -49,27 +52,30 @@ always be `1`.
You can also start by calling `ace-window` and then decide to switch the action to `delete` or `swap` etc. By default the bindings are: You can also start by calling `ace-window` and then decide to switch the action to `delete` or `swap` etc. By default the bindings are:
- <kbd>x</kbd> - delete window - <kbd>x</kbd> - delete window
- <kbd>m</kbd> - swap (move) window - <kbd>m</kbd> - swap windows
- <kbd>M</kbd> - move window
- <kbd>j</kbd> - select buffer
- <kbd>n</kbd> - select the previous window
- <kbd>u</kbd> - select buffer in the other window
- <kbd>c</kbd> - split window fairly, either vertically or horizontally - <kbd>c</kbd> - split window fairly, either vertically or horizontally
- <kbd>v</kbd> - split window vertically - <kbd>v</kbd> - split window vertically
- <kbd>b</kbd> - split window horizontally - <kbd>b</kbd> - split window horizontally
- <kbd>n</kbd> - select the previous window
- <kbd>i</kbd> - maximize window (select which window)
- <kbd>o</kbd> - maximize current window - <kbd>o</kbd> - maximize current window
- <kbd>?</kbd> - show these command bindings
In order for it to work, these keys *must not* be in For proper operation, these keys *must not* be in `aw-keys`. Additionally,
`aw-keys`. Additionally, if you want these keys to work with less than if you want these keys to work with fewer than three windows, you need to
three windows, you need to have `aw-dispatch-always` set to `t`. have `aw-dispatch-always` set to `t`.
## Customization ## Customization
Aside from binding `ace-window`: Aside from binding `ace-window`:
(global-set-key (kbd "M-p") 'ace-window) (global-set-key (kbd "M-p") 'ace-window)
maybe you'd like the following customizations: the following customizations are available:
### `aw-keys` ### `aw-keys`
`aw-keys` - the sequence of leading characters for each window: `aw-keys` - the list of initial characters used in window identifiers:
(setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)) (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))
@ -78,14 +84,14 @@ above, the keys are on the home row.
### `aw-scope` ### `aw-scope`
The default one is `global`, which means that `ace-window` will work The default one is `global`, which means that `ace-window` will work
across frames. If you set this to `frame`, `ace-window` will offer you across frames. If you set this to `frame`, `ace-window` will offer you
the windows only on current frame. only the windows of the current frame.
### `aw-background` ### `aw-background`
By default, `ace-window` temporarily sets a gray background and By default, `ace-window` temporarily sets a gray background and
removes color from available windows in order to make the removes color from available windows in order to make the
window-switching characters more visible. This is the behavior window-switching characters more visible. This is the behavior
inherited from `ace-jump-mode`. inherited from `ace-jump-mode`.
This behavior might not be necessary, as you already know the locations This behavior might not be necessary, as you already know the locations
@ -98,27 +104,29 @@ So you can turn off the gray background with:
When non-nil, `ace-window` will issue a `read-char` even for one window. When non-nil, `ace-window` will issue a `read-char` even for one window.
This will make `ace-window` act differently from `other-window` for one This will make `ace-window` act differently from `other-window` for one
or two windows. This is useful to change the action midway or two windows. This is useful to change the action midway and execute
and execute other action other than the *jump* default. an action other than the default *jump* action.
By default is set to `nil` By default, this is set to `nil`.
### `aw-dispatch-alist` ### `aw-dispatch-alist`
This is the list of actions that you can trigger from `ace-window` other than the This is the list of actions you can trigger from `ace-window` other than the
*jump* default. *jump* default. By default it is:
By default is:
(defvar aw-dispatch-alist
(defvar aw-dispatch-alist '((?x aw-delete-window "Delete Window")
'((?x aw-delete-window " Ace - Delete Window") (?m aw-swap-window "Swap Windows")
(?m aw-swap-window " Ace - Swap Window") (?M aw-move-window "Move Window")
(?n aw-flip-window) (?j aw-switch-buffer-in-window "Select Buffer")
(?c aw-split-window-fair " Ace - Split Fair Window") (?n aw-flip-window)
(?v aw-split-window-vert " Ace - Split Vert Window") (?u aw-switch-buffer-other-window "Switch Buffer Other Window")
(?b aw-split-window-horz " Ace - Split Horz Window") (?c aw-split-window-fair "Split Fair Window")
(?i delete-other-windows " Ace - Maximize Window") (?v aw-split-window-vert "Split Vert Window")
(?o delete-other-windows)) (?b aw-split-window-horz "Split Horz Window")
"List of actions for `aw-dispatch-default'.") (?o delete-other-windows "Delete Other Windows")
(?? aw-show-dispatch-help))
If the pair key-action is followed by a string, then `ace-window` will be "List of actions for `aw-dispatch-default'.")
invoked again to be able to select on which window you want to select the
action. Otherwise the current window is selected. When using ace-window, if the action character is followed by a string,
then `ace-window` will be invoked again to select the target window for
the action. Otherwise, the current window is selected.

@ -280,7 +280,7 @@ LEAF is (PT . WND)."
(defvar aw-dispatch-alist (defvar aw-dispatch-alist
'((?x aw-delete-window "Delete Window") '((?x aw-delete-window "Delete Window")
(?m aw-swap-window "Swap Window") (?m aw-swap-window "Swap Windows")
(?M aw-move-window "Move Window") (?M aw-move-window "Move Window")
(?j aw-switch-buffer-in-window "Select Buffer") (?j aw-switch-buffer-in-window "Select Buffer")
(?n aw-flip-window) (?n aw-flip-window)
@ -288,7 +288,6 @@ LEAF is (PT . WND)."
(?c aw-split-window-fair "Split Fair Window") (?c aw-split-window-fair "Split Fair Window")
(?v aw-split-window-vert "Split Vert Window") (?v aw-split-window-vert "Split Vert Window")
(?b aw-split-window-horz "Split Horz Window") (?b aw-split-window-horz "Split Horz Window")
(?i delete-other-windows "Delete Other Windows")
(?o delete-other-windows) (?o delete-other-windows)
(?? aw-show-dispatch-help) (?? aw-show-dispatch-help)
(?z aw-use-frame "Use new frame")) (?z aw-use-frame "Use new frame"))

Loading…
Cancel
Save