Emacs: avy ace-jump vs isearch

By Xah Lee. Date: . Last updated: .

There's ace-jump package, which lets you jump to any visible position in a buffer by about 4 keys.

ace-jump-mode https://github.com/winterTTr/ace-jump-mode

there's similar package called avy, at https://github.com/abo-abo/avy

emacs avy goto word 1 38802
emacs Alt+x avy-goto-word-1 in action. After the command is called, user types a single letter, and avy highlights places where the letter match beginning of word, and add a letter key (1 to 2 letters), then you type it, to move cursor there.

Besides avy-goto-word-1, avy has:

avy-goto-char
User types 1 char.
avy-goto-char-2
User types 2 chars.
avy-goto-char-timer
User types 1 or more chars, after stopping for 0.5 sec, avy starts to show destinations. (timing can be changed)
avy-goto-line
No user input needed.
avy-goto-word-1
User types 1 char that's word's first letter.
avy-goto-word-0
No user input needed. But lots of choics, every word is a destination.

Avy Does Not Replace Isearch

Avy only works on visible portion of the buffer. So, you still isearch.

This means, if avy is useful, then you need to sacrifice key spots for it.

Avy Has Extra Brain Cost

With Avy, there's a brain cost, of having to look and decide what letter to type to land on the position.

With isearch, it's just muscle memory.

Avy requires:

  1. Muscle reflex to activate the command.
  2. Visual contact to read the screen.
  3. Brain cycle to identify the generated letter letters you want.
  4. Muscle reflex to type the letter.

isearch requires:

  1. Muscle reflex to activate the command.
  2. Visual contact to read screen and decide when to stop.
  3. Muscle reflex to stop moving forward with isearch next occurrence.

Both initially requires you to type a letter, or 2 letters, or string, to begin. But after that, avy requires you to type 1 or 2 letters that are generated out of the blue. You have to visually determine what that letter is then type it. While isearch, you just go by muscle reflex to next/previous.

Level of User Interface Design: Muscle Reflex, Eye, Brain

I came up with this thought about ranking User interface:

1. Best, pure muscle memory. Such as the task of typing with touch-typing. Or, washing one's hands, comb hair, tie shoe lace, where, one does not need visual feedback.

2. require visual contact. Such as moving cursor by arrow key, playing pacman, or scroll window up/down, wielding a hammer. These all require visual contact. Much like carpentry or walking on a unfamiliar road. You need eyes to coordinate the work as you go.

3. requires brain cycle (thinking). Such as how many lines/words argument first (i.e. lots of vi ways are like this). And i put avy's required typing of generated letters in this group, sometimes in a unconscious /autonomous way.

Avy Advantage

The advantage of avy is that it moves to a spot precisely. You trade 1 brain-cycle to reduce the visual feedback of deciding whether your cursor has arrived on the desired position.

Alternative: Commands to Jump to Most Frequently Used Spots

A good alternative, is isearch with efficient keys setup for isearch.

And, several commands that jumps to the most frequently used cursor position.

Here's Xah's system, from Emacs: Xah Fly Keys

[see Emacs: Move Cursor to Beginning of Line/Paragraph]

[see Emacs: Move Cursor to Bracket/Quote]

[see Emacs: Jump to Punctuation]

Each of these jumps to a specific spot that is frequently used cursor position.

Setup Isearch to Use Single-Letter Keys

You should have isearch setup to use arrow keys.

[see Emacs Init: isearch by Arrow Keys]

For basics of isearch, see: Emacs: Search / Highlight Words.