An opinionated Transient-based user interface library for Emacs editing commands.
Casual EditKit endeavors to surface the many different editing commands offered by Emacs via Transient menus. Included in this library are menus for:
- Register commands
- Rectangle commands
- Editing commands for words, sentences, paragraphs, and balanced expressions (sexps), and functions (defuns).
- Marking
- Copying
- Killing
- Moving
- Transposing
- Transforming
- Deleting
- Sorting
- Window management
- Creating
- Moving
- Deleting
- Search & Replace commands
- Open commands
- Project commands
- Bookmark commands
- Emoji & Symbol Insertion (including smart quotes)
- Tool commands
- Macro commands
A main menu (casual-editkit-main-tmenu
) demonstrating all of the above is provided as a reference model. This reference model can be used as is. More motivated users can use the reference model as a template to build their own customized menus.
Emacs has many commands that are easy to forget if not used frequently. Menus are a user interface (UI) affordance that offers discoverability and recognition that can lower its learning curve. While menus are commonly associated with mouse-driven UI, the inclusion of Transient in Emacs core allows for building a keyboard-driven menu UI. Casual EditKit endeavors to offer this as many Emacs users prefer keyboard-driven workflows.
- To provide a keyboard-driven menu UI toolkit for common Emacs editing commands.
- To provide casual access to the above commands.
- Full coverage of all Emacs editing commands. Casual EditKit is not intended to be a power user tool nor is it intended to be a replacement for mouse-driven menus.
- Strict adherence to Emacs editing command naming. While Casual EditKit is mostly in alignment with Emacs 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 EditKit is early in its life-cycle, expect changes to its user experience in terms of menu hierarchy and keybinding choices in future releases.
Typical installation of Casual EditKit is via MELPA. A reference menu (casual-editkit-main-tmenu
) illustrating nearly all the different menus offered by Casual EditKit is provided. This menu can be used “as-is” with your binding of preference. For consistency with other Casual Packages, the binding C-o
is used in the example below. Other candidate bindings include M-o
and F10
. To facilitate default access to this menu, the configuration below sets this binding to be global which can be overridden per mode. This is not mandatory and users are free to integrate Casual EditKit into their Emacs configuration however they see fit.
(require 'casual-editkit) ; optional if using autoloaded menu
(keymap-global-set "C-o" #'casual-editkit-main-tmenu)
For motivated users desiring a bespoke solution, it is recommended that they use Casual EditKit as a library of menus to build their own workflows.
Register commands for saving and recalling text, point, window configuration, and keyboard macros are supported here.
This menu offers all the rectangle commands. It is packaged as a sub-menu of casual-editkit-edit-tmenu
.
This menu contains commands and sub-menus related to editing text.
Depending on the buffer mode, text can be operated on with different granularity as words, sentences, paragraphs, balanced expressions, functions (defuns). The following sub-menus illustrate what operations can be done on the different text granularity.
Text can be marked with different granularity with this menu. Note that marking functions (Defun) is only supported for modes derived from prog-mode
.
Text can be copied with different granularity with this menu.
Text can be cut (killed) with different granularity with this menu.
Text can be moved forwards or backwards with different granularity with this menu. Note that selecting a granularity will raise another menu to allow selection of direction (forward, backward) the text is to be moved. To enable repeat operation, that menu is persisted and must be dismissed either with either C-q
(dismiss all) or C-g
(dismiss to previous menu).
Text can be transposed with different granularity with this menu.
Text can be transformed with different granularity with this menu. Supported transformations are capitalization, lower and upper casing of text.
Operations involving text deletion are included in this menu, including joining lines and zapping to a character.
Sorting operations on different sections of text are supported, as well as support for sorting off a field. Press ?
or C-h
to get help for a specific command.
Commands to reformat text such as filling, centering, and repunctuating sentences are provided here. Press ?
or C-h
to get help for a specific command.
This menu provides support for different Emacs window management commands. Note that in Emacs, window is defined differently than its usage in contemporary graphical user interfaces.
If the variable casual-lib-use-unicode
is set to t
, then Unicode symbols are used in the labels.
This menu provides support for deleting windows.
Operations related to search and replace are captured by this menu. Note that this menu uses Transient prefix arguments (--backward
and --regexp
). This is because some commands have variants involving direction and whether to search using a regexp. Commands that support direction will by default operate forward of the current point if --backward
is not enabled.
Commands related to opening a file (either for writing or read-only) are supported here. Included are commands for visiting and renaming a file or buffer. The Project sub-menu is also offered here.
Project-related commands are listed in this menu.
Commands edit, add, or jump to a bookmark are captured in this menu.
Insert emoji and symbol characters with this menu. Smart quotes are also supported by this menu and can be applied to a text region.
This menu holds an assorted collection of different tools/utilities provided by Emacs. Motivated users can use this Transient prefix as starting point to create a menu customized to their needs.
Commands for managing macros are provided for by this menu. Note that macro creation commands are not supported as they are tightly-bound to keybindings.
Configuration of common editing-related settings are provided here. Most all settings are set via the customize-variable
interface with the following exceptions for:
- “Auto-fill Mode (
auto-fill-mode
)” - “Indent Tabs Mode (
indent-tabs-mode
)” - “Fill Column (
set-fill-column
)”
Those commands will instead apply to the current buffer. The variables listed above can be more permanently set via M-x customize-variable
.
If you enjoy using Casual EditKit, consider making a modest financial contribution to help support its development and maintenance.