Another Great Avy Command

One of the most powerful tricks I’ve learned about using Emacs is from Steve Yegge’s famous post on effective Emacs use in which he recommended using incremental search for navigation. That gave me a huge increase in efficiency. I got an even bigger increase when I started using ace-jump-mode and its later generalization, avy, by abo-abo.

The avy library has many ways of selecting a jump point but they all involve building a jump tree. One of those methods is avy-goto-char-timer. I’ve read its description a few times as I’ve added to my Avy configuration but its usefulness never hit me until I read this tweet from Wilfred Hughes:

It solves a problem that I sometimes have with avy-goto-word-1 (the successor to ace-jump-mode): If you want to jump to a word beginning with a common letter you may have many selections to choose from and the selection labels cover up the beginning of the word. One way to solve this is with avy-goto-char-timer, which allows you to enter a sequence of characters—much like isearch—and it then gives you selections that begin with that sequence.

The “timer” in the command’s name comes from the fact that it considers your entering of the sequence complete when you stop typing for the timer’s value (0.5 seconds by default). I mostly still use avy-goto-word-1 but sometimes avy-goto-char-timer is more efficient and I’ll use that instead. If you don’t like the timer aspect, there’s also avy-goto-char-2, which allows you to enter two characters and build a search tree for those two characters. Its functionality is subsumed under avy-goto-char-timer so I haven’t bothered mapping it to a key sequence.

If you aren’t using one of the Avy functions to navigate, you’re really shortchanging yourself and you should check them out. Avy is available from MELPA so it’s easy to install.

This entry was posted in General and tagged . Bookmark the permalink.