espanso: An Open Source Cross-Platform Text Expander That Will Help You Type Faster and be More Productive

Brief: espanso is a cross-platform text expander tool written in Rust. A text expander lets you use shortcuts instead of typing long words and sentences.

If you’re using keyboard macros or mouse macros, you’re probably already saving a lot of time to get things done.

But, you can’t just use macros to type everything. Yes, maybe a thing or two, but not a lot of things. And, for that very reason, a text expander should come in very handy.

In this article, I’ll take a look at espanso, which is an open-source text expander.

espanso: Open Source Text Expander

Espansos Demo

espanso is an interesting open-source text expander tool with cross-platform support that’s written in Rust programming language.

It doesn’t offer a GUI (Graphical User Interface) to customize or control. You’ll have to resort to terminal or changing YML files for any configuration change. The default settings make it pretty easy to use it.

Basically, it lets you utilize short codes or keywords to quickly write a piece of text. To start with, it offers one basic short code to type the date.

For instance, when you type “:date”, espanso will replace quickly replace it by adding the date as “07/13/2020“. By default, the date format is in the form of MM/DD/YYYY — but you can easily change it (we’ll take a look at it later in this article).

Similarly, you can have any custom keywords or short codes like “:sayhello” to type “Hi there! My name is Ankush Das”

Features of espanso

Espanso Running

Here’s what espanso offers to get you more productive:

  • Supports text expansions when using a shell to help you keep things faster
  • Execute custom scripts with the help of espanso’s keywords
  • Supports adding emojis (needs additional installation)
  • Save code snippets and re-use them with espanso
  • System-wide integration
  • Application-specific configuration option
  • Cross-platform support

In addition to the features I’ve listed, you can actually get a lot more things done if you explore more use-cases and try it out on your system.

Installing espanso on Linux

You can get the DEB package from its GitHub releases section to install it on any Ubuntu-based distribution. Even though most of you know how to install a .deb package, if you’re new, you may take a look at the ways to install DEB files in Ubuntu.

For Ubuntu-based distros, if you encounter an error to launch it from the terminal, make sure to type in the command below to ensure that you have the necessary packages for it to work:

sudo apt update
sudo apt install libxtst6 libxdo3 xclip libnotify-bin

You can also install it on your Arch system / Manjaro distribution through AUR.

For other Linux distribution, you can use the snap package to get it installed.

If you didn’t know about installing snaps, I’d recommend you to refer our guide on installing and using snaps on Linux.

For installation and download instructions, you can refer to espanso’s official installation instructions.

How To Use espanso?

Because there’s no GUI, some of you may need some time to figure out how it works. So, to save you the trouble, let me share a few tips to get started using espanso.

Launching & Setting it up

Once you’ve successfully installed espanso, you need to launch it to set it up.

To do that, simply type in the following in the terminal:

espanso start

It should ask you to add the process to launch when your computer boots up, you can allow it to proceed if you want it that way. If you hit no, you will have to manually start espanso manually every time you log in to your system.

You can always register the service to systemd later by typing the following command:

espanso register

To verify if it’s running, you may want to type in:

espanso status

Sometimes the shortcodes might conflict with your regular usage. So, when you need to stop it, just hit the following in the terminal:

espanso stop

You can explore more commands and options for espanso by typing “espanso” or “espanso -h” in the terminal to get the details.

Basic Configuration of Expanded Texts

You might want to refer the official documentation if you’re using Windows or macOS. Here, I’ll show you how to customize or add custom expanded texts on Linux.

To get started, navigate your way through the home directory (by enabling the hidden files) and head into the /.config/espanso folder.

Espanso Customizing

Once you’re here, you’ll find a default.yml file as shown in the screenshot above. This is the default configuration file of espanso.

You have to open it with your default text editor. It should look something like this:

Espanso Default Config

If you look close enough, you can notice the preset texts and the short codes or keywords for it.

You can choose to edit the existing ones (just like I modified the format of the date in the screenshot above) or add new ones as required.

When you want to add a new keyword for text expansion, you can do that by simply copy-pasting the following format right below the existing matches:

  - trigger: ":YourKeywordHere"
    replace: "Text That You Want To Be Replaced With The Keyword"

You need to add your custom keywords and text as needed and save the modifications to the file and it’s done!

You may get a notification of a successful configuration re-load. If you don’t, simply head to the terminal and restart espanos to see refresh the new configuration.

If it gives you an error, you might want to adjust the spacing of what you wrote and make sure it’s correct. To give you an idea, here’s how it looks after adding new keywords:

Espanso Modified Config
Espanso Modified Configuration file

Here, I’ve pointed out an example of basic customization. You can also perform application-specific matches and other advanced configuration by following the official documentation.

Wrapping Up

While I didn’t know about this amazing tool before covering it – but now that I do, it’s proving to be a very useful tool that could save me a lot of time.

What do you think about espanso? Let me know your thoughts in the comments below!

Similar Posts

  • I discovered Espanso a few weeks back. It solved a note-taking issue I was having quite elegantly and with little effort. As for the U.S. date, sure it is stupid, but most Espanso users are probably in the U.S., and I believe the author is too. I used yyyy/mm/dd. But I don’t see the point in scolding everyone about it.

    • # Dates
      – trigger: “:date”
      replace: “{{mydate}}”
      vars:
      – name: mydate
      type: date
      params:
      format: “%Y/%m/%d %T”

      Output: 2021/04/29 12:23:55

  • I stopped reading at that date format. Whoever figured out the MMDDYYYY format is most likely the most clueless illogical fool on the planet. I don’t understand why people use such and idiotic format in the first place. Don’t they know anything about sequences? Or like spelling labour as labor. Some people really need some actual education – and it shows. Then we, in countries where we did have good education, have to put up with stuff like Grammarly that can’t spell. It is because they call a spelling checker a spell checker. They must be into exorcism then.

    • You must be living in a bubble if you never noticed that MM/DD/YYYY is the traditional date format in the US. (Or, your irony does not get through to me.) It certainly has drawbacks, but traditions die hard. What do you think about pounds and miles?

      • OK, the US is a tiny fraction of the big world. Don’t live in a bubble, I don’t. There’s 7.65 billion of us out there.

        • Relax, man. Up to very recently the US was #1 in the world, it may still be, and it certainly is in IT. Also note that we are conversing in English, which is not my native language. So if you were unaware of the fact that month/day/year is the American tradition, you were in a bubble. (Don’t think I’m biassed, I don’t live in the US, I never was in the US in my life, the date format in my country is year-month-day, that is what looks natural to me.)

          • No, I’m in no bubble. I just like to point out how sheeples follow illogical tradition yet boss around the world. English isn’t my mother tongue, either. I come from where we know God didn’t try 11 times the breathe a Hebrew-Greek book in Elizabethan English.

      • Yes. Splitting the day into 24 hours and the hour into 60 minutes is also counterproductive. Like so many other traditions.

    • what? if something is natural to someone it does not mean it is right or wrong its about what someone follows nothing wrong in it. it’s alright till the message is delivered if you see how people spell numbers in different countries you might lose it. also, a good education is not to rant about some format. if you try to improve that attitude your life may improve

      • I have learned long ago you can’t educate idiots, like the business consultants in NY that, over a decade ago, believed that 98% of the global population were online. Maybe their globe didn’t go begond Queens.