defcustom

phil-s edited this page Jun 28, 2018 · 6 revisions

This page includes a summary for each defcustom.

avy-keys

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=.

Examples:

;; 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)
                      '(?0)))

avy-keys-alist

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.

Example:

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

avy-style

The default overlay display style.

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

Four 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.

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.

avy-styles-alist

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.

avy-background

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.

Example:

(setq avy-background t)

You can also customize avy-background-face.

avy-all-windows

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.

avy-case-fold-search

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. See also =case-fold-search=.

Example

(setq avy-case-fold-search nil)

avy-highlight-first

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.

Example:

(setq avy-highlight-first t)

avy-timeout-seconds

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

Example:

(setq avy-timeout-seconds 0.8)
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.