An opinionated Transient-based menu for Avy, a GNU Emacs package for jumping to visible text using a char-based decision tree.
While highly functional, Avy has a steep learning curve as it has a very diverse command set. Menus are a user interface (UI) affordance that offer users discoverability and recall that can lower Avy’s learning curve. While menus are commonly associated with mouse-driven UI, the inclusion of Transient in Emacs core allows for a menu UI that is keyboard-driven. Casual Avy endeavors to offer this as many Emacs users prefer keyboard-driven workflows.
- To provide a keyboard-driven menu UI for Avy.
- To provide casual access to the Avy command set.
- Full coverage of all Avy commands. Casual Avy is not intended to be a power user tool.
- Strict adherence to Avy command naming. While Casual Avy is mostly in alignment with Avy’s command naming, there are cases where it will make an opinionated change if the name is deemed too vague or idiomatic.
- UX Stability (for now). Given that Casual Avy is early in its life-cycle, expect changes to its user experience in terms of menu hierarchy and keybinding choices in future releases.
Casual Avy has been verified with the following configuration.
- Emacs 29.3 (macOS 14.4.1, Ubuntu Linux 22.04.4 LTS)
- Avy 0.5.0
As Casual Avy is new, we are looking for early adopters! Your feedback is welcome as it will likely impact Casual Avy’s evolution, particularly with regards to UI.
If installed via MELPA (pending) then add these lines to your Emacs initialization file with your binding of preference.
(require 'casual-avy) ;; optional
(keymap-global-set "M-g" #'casual-avy-tmenu)
If you use use-package
, here is the recipe for installing it.
(use-package casual-avy
:ensure t
:bind ("M-g" . casual-avy-tmenu))
Casual requires Emacs 29.1+.
A number of Avy commands have the option to limit the scope of candidates to the visible part of the current buffer above or below the point. Such commands are denoted with the ‘#’ or ‘⬍’ symbol. Press a
to limit the scope above the point, b
for below.
The commands listed under Edit Other Line/Region can perform an operation on a visible line or region while keeping the point stationary. This enables a workflow where a different visible part of the Emacs frame can be operated on without having to move the point.
The following glossary details the meaning of the menu labels.
Menu Label | Operation |
---|---|
Copy | Copies the selected object (line, region) into the kill ring. |
Kill | Kills the selected object into the kill ring. |
Move to above current line | Moves the selected object to the line above the current point. |
Duplicate to above current line | Duplicates the selected object to the line above the current point. |
By enabling “Use Unicode Symbols” from the Settings menu, Casual Avy will use Unicode symbols as appropriate in its menus. The following mapping is shown in the table below:
Name | Plain | Unicode |
---|---|---|
Scope | # | ⬍ |
Casual Avy is built using Transient menus and as such adopts much of its default behavior.
Each menu item has a key and a label. The key is what is typed by the user to select the menu item. A key can be prefixed with a meta (M-) or control (C-) key.
Dismissing a menu regardless of how deep you are in sub-menus can be done by entering C-q
. A menu can also be dismissed by entering C-g
, but this will return you to the parent menu.
If a mouse is available, a menu item can be selected by moving the mouse cursor over its label and pressing down button 1.
Pressing the ?
key will toggle help for all the menu items. Press the key of interest to get help for it.
Options such as --above
and --below
can be saved for future use by typing C-x C-s
.
When a Transient menu is raised, a prefix argument (C-u
) can be entered before selecting a menu item.
For users who wish to help contribute to Casual Avy or personally customize it for their own usage, please read the developer documentation.
If you enjoy using Casual Avy, consider making a modest financial contribution to help support its development and maintenance.
If you like Casual Avy, these other projects might interest you:
- cc-isearch-menu - A Transient menu for isearch.
- Casual - an opinionated Transient porcelain for Emacs Calc.
- Casual Dired - an opinionated Transient porcelain for the Emacs file manager Dired.
A heartfelt thanks to all the contributors to Avy and Transit. Casual Avy would not be possible without your efforts.