Skip to content
Dave Chesser edited this page Oct 13, 2020 · 9 revisions

This page includes a summary for each defcustom.


The list of the default decision chars.

Customizations to it take effect for all commands, but you can also override it per-command using =avy-keys-alist=.


;; Home row only (the default).
(setq avy-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))

;; Any lower-case letter a-z.
(setq avy-keys (number-sequence ?a ?z))

;; Any lower-case letter or number.  Numbers are specified in the keyboard
;; number-row order, so that the candidate following '9' will be '0'.
(setq avy-keys (nconc (number-sequence ?a ?z)
                      (number-sequence ?1 ?9)


The alist of decision chars for each command.

This allows for a more precise customization than =avy-keys=. Any command that don’t have an entry in avy-keys-alist will use avy-keys.


(setq avy-keys-alist
      `((avy-goto-char . ,(number-sequence ?a ?f))
        (avy-goto-word-1 . (?f ?g ?h ?j))))


The default overlay display style.

This setting will be used for all commands, unless overridden in =avy-styles-alist=.

Six styles are currently available:

  1. pre: - full path before target, leaving all original text.
  2. at: - single character path on target, obscuring the target.
  3. at-full: full path on target, obscuring the target and the text behind it.
  4. post: full path after target, leaving all original text.
  5. de-bruijn: like at-full but the path is in a De Bruijn sequence.
  6. words: like at-full, but the path consists of words as defined by =avy-words=.

At first it seems that pre and post are advantageous over at and at-full, since you can still see the original text with them. However, they make the text shift a bit. If you don’t like that, use either at or at-full.


The alist of overlay display styles for each command.

This allows for a more precise customization than =avy-style=. Any command that don’t have an entry in avy-styles-alist will use avy-style.

Here’s the setting that I’m using:

(setq avy-styles-alist '((avy-goto-char-2 . post)))

Since the two chars in avy-goto-char-2 are in a sequence, it makes sense for the decision chars to also follow that sequence, hence post is used.


When non-nil, a gray background will be added during the selection.

This is off by default. While it can allow you to focus better on the decision chars, it can be distracting.


(setq avy-background t)

You can also customize avy-background-face.


There are three choices for this variable, which determine which windows will be searched for jump candidates:

  • nil: use only the selected window
  • t: use all windows on the selected frame
  • all-frames: use all windows on all frames

It’s t, just to show to the new users that they have an option to use all windows. I set it to nil to only use the current window. This results in less candidates and less interruption.

(setq avy-all-windows nil)

Note that for each command you can negate the current setting of avy-all-windows by using a prefix argument. So whan I have avy-all-windows nil, but I happen to want to use all windows in one case, I just use C-u (universal-argument) before the command.


When non-nil, the searches should ignore case. This is on by default, since it’s usually cheaper to have a bit more candidates rather than having to press the Shift key. When nil, only if given Upcase letter, the searches should icluding case. See also =case-fold-search=.


(setq avy-case-fold-search nil)


When non-nil highlight the first decision char with avy-lead-face-0. Do this even when the char is terminating.

Normally avy-lead-face-0 is only used for the first non-terminating decision chars.


(setq avy-highlight-first t)


This determines how many seconds avy-goto-char-timer should wait before switching between avy-goto-char-2 and avy-goto-char.


(setq avy-timeout-seconds 0.8)


If you would like to have the places that are closest to the point have shorter key sequences, you can customize it like this:

(setq avy-orders-alist
      '((avy-goto-char . avy-order-closest)
        (avy-goto-word-0 . avy-order-closest)))

Note that the tradeoff is that the key sequences now depend on your point position, not just on the window contents.


The list of words that serves as the path instead of a generated sequence. If there are more choices than there are words in the list, the remainder will continue on as the at-full style.

 ;; This is a small portion of the default `avy-words' list.
 ;;   and is by no means exhaustive.
 (setq avy-words
	'("am" "by" "if" "is" "it" "my" "ox" "up"
	  "ace" "act" "add" "age" "ago" "aim" "air"
	  "ale" "all" "and" "ant" "any" "ape" "apt"))