How have I only just found Espanso?!?

August 15, 2021 4 min read
Espanso Logo
Espanso's Logo

Personal Knowledge Management (PKM) is a really hot topic these days with not just an explosion of content on YouTube but also a ton of courses available to study, with one of the most popular currently being Building a second brain. I've not had a chance to try that course yet as I missed the last cohort by one day but I indeed to sign up for the next one. A key component of the idea is that your brain is great for having ideas and making connections but not so great at hoarding information. With a second brain, you dump out that knowledge or insists into a system where you can easily tap them later.

There's a lot of software targeting this field such as Roam Research, Notion and the heavy weight Evernote. Each has its own approach but I've actually been really excited about another PKM called Obsidian. It is fully Markdown based and keeps all of its files locally. I really like the simplicity and with the plugin interface it's super extensible (not to mention the authors are insanely responsive).

A key feature I used in Doom Emacs was the Journal Mode in Org Mode. One of the great features was that each day it would create me a new file nicely dated and I could start typing in my notes as I went throughout my day. It had a key combo that would inject the current timestamp which made it really easy to keep track of when things happened or started. I found that Obsidian offers that functionality too, except it couldn't do timestamps!

I started digging around to see if anyone had found a nice way to do this and an app called Espanso kept cropping up as the ultimate solution so I decided to check it out. What I found was a tool that could change my workflow significantly.

What is Espanso?

At its most basic Espanso is a tool that monitors key presses when it sees certain combination, it rewrites it with whatever text you've set. Espanso works system wide, in any application which immediately tells you that it's monitoring the keyboard all the time. However Espanso works in a privacy friendly way by not storing any history and only using the the key presses to update its internal state machine. This way it can capture key presses, but it never actually stores or logs them anywhere. Of course, you should ensure that you're happy that that is what it actually does (they have a SECURITY.md that contains the details) but there are a number of contributors, many builds for different platforms and an active subreddit.

To give an example of what it does, I often use this as my email signature:

Kind Regards,

Peter Membrey

With Espanso, I can type :kr and have it replace that with the email signature. That's pretty cool and it's something I write a number of times a day, often in different text editors before finally getting it into my mail client.

Espanso isn't limited to just replacing text however. It can get output from scripts or shell commands, and even place the cursor within the replacement text. The example their website gives is replacing :div with <div></div>. Okay, that's not exciting, but what it actually does is it puts the cursor between the two tags meaning you can start typing right away! Using the image_path option it can even paste pictures into an application, which works surprisingly well. I haven't even played with the Form feature yet that brings up a nice Form UI that you can fill out key boxes for and then it generates the templated text.

All that aside, was I able to get my timestamp? Happily yes and it was much easier than I thought it would be (not least because now it works in every application I have)!

How else is it cool?

Well, I really like the nice way it does configuration with everything in a simple yaml based config file. If you're doing dot file management (and you should be - trust me), you'll find it's really easy to get Espanso configured through your tool of choice. It also allows for relative paths to its config directory, which means if you do use it to send images, you can store those with your config and make sure that everywhere you have Espanso, you have your images ready to go.

I'm going to play with this more over the next few weeks and see how much it really helps me, but it just goes to show how easy it is some times to miss some otherwise great software.

espansotext expanderprivacyproductivity
Peter Membrey
Written By Peter Membrey

Peter Membrey is a Chartered Fellow of the British Computer Society, a Chartered IT Professional and a Chartered Engineer. He has a doctorate in engineering and a masters degree in IT specialising in Information Security. He's co-authored over a dozen books and a number of research papers on a variety of topics. These days he is focusing his efforts on creating a more private Internet, raising awareness of STEM and helping people to reach their potential in the field.

Read next