Espanso (multi-platform text expander) Snippet Showcase
[x] Linux [x] MacOS [x] Windows [-] iOS [-] Android
Espanso (GitHub) is a file-based, system-wide text expander available for Linux, MacOS and Windows. Since it’s obviously in use by many Obsidians, I thought it might be worthwhile to have a Snippet Showcase for it.
Note: Espanso doesn’t work on mobile.
To keep this somehow readable, let’s agree on some simple rules here, please:
Use a H2 header (##) to say what the snippet does in a short phrase (i.e. “ISO-8601 date shortcuts”).
Use a line like above to clearly state if your snippet works on [x] Linux, [x] MacOS and/or [x] Windows so users will instantly know if it works on their platform. This is crucial if using shell commands!
[x] = yes, it works and I have tested it
[-] = no, it doesn’t work on this platform (i.e., Windows PowerShell commands on Linux or MacOS)
[?] = I really don’t know and I can’t test it, but I suppose it might.
No posts stating “It can be done with Alfred/aText/Autohotkey/Whatever”. We appreciate that, but this thread is about espanso.
If you change or update your snippet, please do in the original post, maybe followed by a short change log. Don’t create a new post for each change—others will thank you, and links stay intact.
Note: You don’t have to re-learn: This uses the same emoji code names as this forum and most other big players like Discord. (Underscores in names have been replaced by blanks, for ease of typing, so it’s not :white_check_mark: but :white check mark:.)
will return a list of paths to your Config, Packages and Data files.
For use within Obsidian, you can construct a link to quickly open your default.yml like so: Take the “Config” path from above command and make a file:// link in your note to default.yml:
I’m on Linux, so mine looks as follows:
- Local [default.yml](file:///home/matthias/.config/espanso/default.yml)
Note: You cannot use $HOME or ~ as an abbreviation for your home folder here!
Now, in Obsidian, I only have to click on the default.yml link and it will open in the associated program (a text editor, in my case).
Temporarily dIsabling espanso
For documentaion and other purposes, you might want to temporarily disable espanso: Hit Alttwice in rapid succession. You should get an on-screen notification.
**TODO: ** What is the key on a Mac? Opt?
This is a toggle, so doing it again will re-enable espanso.
Auto-reload when changing default.yml
Whenever you change and savedefault.yml (which contains your snippets), you should get a “Config reloaded” notification. Espanso tries to detect changes and reloads automatically.
If this should fail for some reason or other, type espanso restart in a console.
A <kbd>…</kbd> command for the forums and Obsidian
[x] Linux [x] MacOS [x] Windows
I hate having to manually type <kbd>bla-bla</kbd> in my notes and in the forum, just to get a bla-bla key!
So I use espanso for that. To stay compatible with the HTML utilities package (espanso install html-utils-package), I use a double colon :: as trigger start here:
# HTML <kbd>|</kbd>
- trigger: "::kbd"
replace: >-
<kbd>$|$</kbd>
The $|$ sequence places the cursor in between <kbd> and </kbd>, after expansion, so I just have to type whatever key name I want.
Note: This is only required on Linux. MacOS and Windows versions above 0.7 apparently have it included.
Espanso can run without having modulo installed—you only lose the forms input.
Installing modulo is pretty straightforward, it being packaged as an AppImage. Here’s one way (of many) to install modulo on a Linux system (Linux Mint, in my case). I store AppImages in a separate AppImages folder within my home folder.
# Make sure to have the $HOME/AppImages directory
mkdir -p $HOME/AppImages
# Download the latest Modulo AppImage in the $HOME/opt
wget https://github.com/federico-terzi/modulo/releases/latest/download/modulo-x86_64.AppImage -O $HOME/AppImages/modulo.AppImage
# Make it executable:
chmod +x $HOME/AppImages/modulo.AppImage
# Create a link to make modulo available as "modulo"
sudo ln -s $HOME/AppImages/modulo.AppImage /usr/bin/modulo
Note that these steps can be changed in many ways, the only requirement is that the modulo binary is available as modulo in the PATH.
Try by typing modulo --version or modulo --help in a console.