• Stars
    star
    1,704
  • Rank 27,394 (Top 0.6 %)
  • Language
    Emacs Lisp
  • Created over 9 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Jump to things in Emacs tree-style

GNU ELPA MELPA MELPA Stable

Introduction

avy is a GNU Emacs package for jumping to visible text using a char-based decision tree. See also ace-jump-mode and vim-easymotion - avy uses the same idea.

logo

Command overview

You can bind some of these useful commands in your config.

avy-goto-char

Input one char, jump to it with a tree.

(global-set-key (kbd "C-:") 'avy-goto-char)

After C-: b:

avy-goto-char

avy-goto-char-2

Input two consecutive chars, jump to the first one with a tree.

The advantage over the previous one is less candidates for the tree search. And it's not too inconvenient to enter two consecutive chars instead of one.

(global-set-key (kbd "C-'") 'avy-goto-char-2)

After C-' bu:

avy-goto-char-2

avy-goto-char-timer

Input an arbitrary amount of consecutive chars, jump to the first one with a tree.

This is a more flexible version of avy-goto-char-2. First part works similarly to isearch: you type a query and it's highlighted dynamically on the screen. When you stop typing for avy-timeout-seconds (0.5s by default), you'll be able to select one of the candidates with avy. As you're inputting characters, you can use C-h (backspace) or DEL (delete) to forget the last typed character and RET to end the input sequence immediately and select a candidate.

avy-goto-line

Input zero chars, jump to a line start with a tree.

(global-set-key (kbd "M-g f") 'avy-goto-line)

After M-g f:

avy-goto-line

You can actually replace the M-g g binding of goto-line, since if you enter a digit for avy-goto-line, it will switch to goto-line with that digit already entered.

avy-goto-word-1

Input one char at word start, jump to a word start with a tree.

(global-set-key (kbd "M-g w") 'avy-goto-word-1)

After M-g wb:

avy-goto-word-1

avy-goto-word-0

Input zero chars, jump to a word start with a tree.

Compared to avy-goto-word-1, there are a lot more candidates. But at a least there's not need to input the initial char.

(global-set-key (kbd "M-g e") 'avy-goto-word-0)

After M-g e:

avy-goto-word-0

Org-mode commands

  • avy-org-goto-heading-timer: Type part of an Org heading. When you stop typing, if only one heading on the screen matches, it will be jumped to; if more than one matches, you can jump to a heading with Avy. This is like avy-goto-char-timer but for Org headings.
  • avy-org-refile-as-child: With point in an entry you want to refile, run this command, select a heading with Avy, and the entry will be refiled as its first child heading. This makes it quick and easy to refile to headings that are visible on-screen, even to other windows or buffers.

Other commands

There are some more commands which you can explore yourself by looking at the code.

Bindings

You add this to your config to bind some stuff:

(avy-setup-default)
(global-set-key (kbd "C-c C-j") 'avy-resume)

It will bind, for example, avy-isearch to C-' in isearch-mode-map, so that you can select one of the currently visible isearch candidates using avy.

Customization

See the comprehensive custom variable list on the defcustom wiki page.

See how to write your own avy commands on the custom-commands wiki page.

Contributing

Copyright Assignment

Avy is subject to the same copyright assignment policy as Emacs itself, org-mode, CEDET and other packages in GNU ELPA. Any legally significant contributions can only be accepted after the author has completed their paperwork. Please see the request form if you want to proceed.

The copyright assignment isn't a big deal, it just says that the copyright for your submitted changes to Emacs belongs to the FSF. This assignment works for all projects related to Emacs. To obtain it, you need to send one email, then send one letter (if you live in the US, it's digital), and wait for some time (in my case, I had to wait for one month).

Style

The basic code style guide is to use (setq indent-tabs-mode nil). It is provided for you in .dir-locals.el, please obey it.

Before submitting the change, run make compile and make test to make sure that it doesn't introduce new compile warnings or test failures. Also run make checkdoc to see that your changes obey the documentation guidelines.

Use your own judgment for the commit messages, I recommend a verbose style using magit-commit-add-log.

More Repositories

1

swiper

Ivy - a generic completion frontend for Emacs, Swiper - isearch with an overview, and more. Oh, man!
Emacs Lisp
2,284
star
2

hydra

make Emacs bindings that stick around
Emacs Lisp
1,818
star
3

lispy

Short and sweet LISP editing
Emacs Lisp
1,195
star
4

org-download

Drag and drop images to Emacs org-mode
Emacs Lisp
1,055
star
5

ace-window

Quickly switch windows in Emacs
Emacs Lisp
968
star
6

oremacs

My Emacs config
Emacs Lisp
296
star
7

auto-yasnippet

quickly create disposable yasnippets
Emacs Lisp
243
star
8

pamparam

Simple and fast flashcards for Emacs
Emacs Lisp
228
star
9

ace-link

Quickly follow links in Emacs
Emacs Lisp
210
star
10

lpy

Minimal Python IDE for GNU Emacs
Emacs Lisp
185
star
11

define-word

Display the definition of word at point in Emacs
Emacs Lisp
154
star
12

tiny

Quickly generate linear ranges in Emacs
Emacs Lisp
143
star
13

worf

vi-like bindings for org-mode
Emacs Lisp
132
star
14

function-args

C++ completion for GNU Emacs
Emacs Lisp
120
star
15

orca

ORg CApture
Emacs Lisp
104
star
16

swiper-helm

Helm version of swiper
Emacs Lisp
79
star
17

helm-make

Select a Makefile target with helm.
Emacs Lisp
62
star
18

plain-org-wiki

Simple jump-to-org-files in a directory package
Emacs Lisp
53
star
19

make-it-so

Transform files with Makefile recipes
Emacs Lisp
47
star
20

org-fu

My org-capture and org-protocol setup
Emacs Lisp
37
star
21

cook

Makefile -> Cookbook.py
Python
36
star
22

whicher

Audit and install the programs that your Emacs config depends on
Emacs Lisp
23
star
23

eclipse-theme

Eclipse theme for Emacs
Emacs Lisp
21
star
24

orly

Additional Org-mode link types and completion for them
Emacs Lisp
18
star
25

helm-j-cheatsheet

Quick J reference for Emacs
Emacs Lisp
17
star
26

zoutline

Emacs library for outlines
Emacs Lisp
16
star
27

gtk-pomodoro-indicator

A simple pomodoro indicator for Unity/GTK tray
Python
16
star
28

elf-mode

Show symbol list when opening a binary file in Emacs
Emacs Lisp
13
star
29

matlab-mode

My fork of matlab-mode
Emacs Lisp
13
star
30

short-lambda

Clojure-style anonymous function literal for Elisp
Emacs Lisp
12
star
31

centimacro

Assign multiple macros as global key bindings in Emacs
Emacs Lisp
12
star
32

xlx

XML <-> LISP converter
Common Lisp
11
star
33

eltex

Write LaTeX in Emacs Lisp
Emacs Lisp
10
star
34

headlong

reckless completion for Emacs
Emacs Lisp
10
star
35

semimap

.Xmodmap that uses semicolon as a modifier
8
star
36

dired-guess

Associate file extensions with programs that can open them for dired
Emacs Lisp
8
star
37

cc-chainsaw

A few tricks to make c++-mode go
Emacs Lisp
7
star
38

ukrainian-holidays

Ukrainian holidays for Emacs calendar
Emacs Lisp
7
star
39

org-mode

http://orgmode.org/org-mode.git
Emacs Lisp
6
star
40

profile-dotemacs

My mirror of http://www.randomsample.de/profile-dotemacs.el
Emacs Lisp
6
star
41

abel

abbrevs for Elisp
Emacs Lisp
5
star
42

touchpad

Toggle touchpad on/off
Python
5
star
43

cedet

My mirror of CEDET (http://cedet.sourceforge.net/).
Emacs Lisp
5
star
44

abo-abo.github.io

HTML
4
star
45

ido-occasional

Use ido where you choose
Emacs Lisp
4
star
46

netherlands-holidays

Netherlands holidays for Emacs calendar
Emacs Lisp
4
star
47

latex-wrap

Wrap selection with a LaTeX environment
Emacs Lisp
4
star
48

simple-benchmark

My notes comparing several PL on a simple benchmark
C++
4
star
49

ciao

Emacs Lisp
4
star
50

xkb-indicator

GTK indicator that allows to run setxkbmap via a keybinding
Python
2
star
51

malk

a simple multi-collection completion demo
Emacs Lisp
1
star
52

soap

Smart Operator a posteriori
Emacs Lisp
1
star