ESPANSO
Speed up text-based tasks with Espanso
Nick Peers reveals how to boost your productivity with a free text replacement tool that has a multitude of different uses.
OUR EXPERT
Nick Peers has been playing around with computers for over 30 years, and has been dabbling with Linux for the best part of a decade.
When it comes to time-saving tools, the text expander is one of the most universally W useful. Everyone has to type words, phrases and sentences, but smart text expander tools such as Espanso do more than simply enable you to save time entering repetitive information – you can also use it as a universal autocorrect tool, or to quickly populate an email with a specific template, insert system information such as your IP address or even quickly embed bits of code with the minimum of fuss.
Get set up
Espanso comes in two flavours depending on whether you’re running the X11 or Wayland desktop environment. Wayland support is currently described as “experimental”, which means several Espanso features are missing – the most crucial one is appspecific configurations (see https://espanso.org/docs/ configuration/app-specific-configurations/ for details).
Syntax is all-important with Espanso – make sure everything is aligned otherwise you see this error.
As a rule of thumb, anyone running Ubuntu 21.04 or later is running Wayland, but you can confirm this by opening Settings, selecting About and seeing what’s listed under Windowing System – you can opt to log into a X11 session. Now head over to https://espanso. org/docs/install/linux/ to locate instructions for obtaining Espanso either as a DEB package (recommended for Ubuntu and Debian) or AppImage – make sure you choose the right version for X11 or Wayland. The following instructions apply exclusively to Debian and Ubuntu users running Wayland. First, download the DEB installer: $ wget https://github.com/federico-terzi/espanso/ releases/download/v2.1.8/espanso-debian-waylandamd64.deb $ sudo apt install ./espanso-debian-wayland-amd64.deb
QUICK TIP
You don’t need to commit all your Espanso shortcuts to memory – just press Alt+Space to open its search bar, which lists all snippets, sorted alphabetically by their replacement text. The shortcut is listed on the right – click this or use the Alt+keyboard shortcut to trigger it.
MULTIPLE-CHOICE MATCHES
As your library of trigger/replace pairs grows, it may be hard to keep track of related pairs – for example, you may have a library of email signatures, but can’t recall which trigger works with which signature. The solution is to group them all under a single trigger: - trigger: “:signoff” replace: “Yours sincerely,\nBob Smith” - trigger: “:signoff” replace: “Regards,\nBob Smith” - trigger: “:signoff” replace: | Kind regards Bob Now when you type :signoff , Espanso opens its search bar, with all available choices listed in alphabetical order. Simply click or press the appropriate shortcut (Alt+ number) to select one.
Setting up multiple-choice matches works perfectly with fixed text, but when you introduce variables, things can get confusing because Espanso uses the contents of the replace expression – the variable name – as a description in the pop-up box. The solution is to add a label expression immediately after the replace expression to provide the description: / label: “Insert next week’s date”