Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/karthink/elmo
Embark Live MOde for Emacs
https://github.com/karthink/elmo
Last synced: 1 day ago
JSON representation
Embark Live MOde for Emacs
- Host: GitHub
- URL: https://github.com/karthink/elmo
- Owner: karthink
- Created: 2021-10-24T23:06:55.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-11T03:26:36.000Z (about 3 years ago)
- Last Synced: 2024-06-26T07:20:55.709Z (5 months ago)
- Language: Emacs Lisp
- Size: 6.84 KB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
#+TITLE: Elmo - Embark Live MOde for Emacs
#+AUTHOR: Karthik Chikmagalur
#+DATE:
#+OPTIONS: h:3 num:nil toc:nil[[https://user-images.githubusercontent.com/8607532/138616783-9748af72-c839-42f6-8d12-a48d653b5c05.png]]
This is a collection of opinionated customizations to use [[https://github.com/oantolin/embark][Embark]] live buffers as my incremental completion and selection system. This has been kicking around in my config for an year but I was inspired to package it by the similar [[https://gitlab.com/protesilaos/mct][MCT]] (Minibuffer and Completions in Tandem) feature.
** Great, another one of these. What's wrong with Vertico/Ivy/Selectrum/Icomplete?
Nothing, they're great. I prefer the free-form interaction of a regular buffer to the tightly prescribed form in the minibuffer. That way I can use all my regular Emacs muscle memory and jump/edit commands to interact with completion candidates (Isearch, Avy, easy-kill, expand-region, register and rectangle commands etc), and avoid context switching.*** Why not use the standard Completions buffer then?
I might switch after Emacs 28 is released, the default Completions buffer is getting some upgrades.
** What is Elmo good at?
It does the usual stuff you expect from an incremental completion system for Emacs. Here are some differences:- No completion list until you type a minimum number of chars. I prefer this noise-free approach for most quick actions.
- Use all your regular buffer commands. Here I use a rectangle command:
https://user-images.githubusercontent.com/8607532/138616738-3f073479-577e-4cab-9b6e-0166f4da1193.mp4- Switch on-the-fly between a list and grid display of candidates:
https://user-images.githubusercontent.com/8607532/138616750-a00d845b-4260-464e-9d38-e1b25f43727d.mp4
- Run embark actions on candidates directly with =embark-collect-direct-action-minor-mode=** What is it bad at?
- It can be slow with large numbers of completions, especially with annotations turned on.
- It does not show candidate groups (such as with Consult commands).** How do I use it?
Run =elmo-mode=.Needless to say Embark needs to be available as a feature. Works well with Consult. Consider installing Marginalia too.
The completions are in a *regular* (actually embark-collect) read-only buffer, so you can navigate as usual:
- ~C-n~, ~C-p~ (or just ~n~, ~p~, ~f~, ~b~) to cycle through candidates,
- ~C-v~, ~M-v~ to scroll up/down (including from the minibuffer),
- ~M-q~ to toggle between a list and grid
- ~C-s~ to isearch, as well as any other regular command you use.
- ~C-l~ to toggle the completions,
- ~C-M-l~ to export them with Embark.The return key works like Ido: ~RET~ will pick the top completion or "enter" directories. Use ~C-j~ to use the actual minibuffer input.
Tweak as necessary:
- =elmo-min-input=: How many characters to type before popping up the completions. (Default is 3.)
- =elmo-always-show-list=: List of commands for which the Embark live completions should pop up immediately.
- =elmo-initial-delay=: How long (in secs) to wait before popping up the completions, after the minimum input condition is met. Picks up defaults from your Embark settings, you don't need to set this.
- =elmo-update-delay=: How long (in secs) after each keystroke before updating the candidate list. Picks up defaults from your Embark settings, you don't need to set this.
** Acknowledgments
- [[https://github.com/oantolin/][Omar Antolin]] for Embark, which does all the work
- [[https://protesilaos.com/][Protesilaos Stavrou]] for mct.el
- [[https://github.com/minad][Daniel Mendler]] for Vertico and vertico-directory