Espanso: Because Who Actually Likes Typing Out Their Emails?

Nikola Breลพnjak - Apr 1 - - Dev Community

Originally published on my blog

TL;DR

Espanso is a text expander tool that will save you lots of repetitive typing. For real.

Ever had to repeatedly type your email address into a form? Check.
How about your name? Surname? Email signature? Check. Check. Check.

Well, instead of risking a typo โ€” like sending that standout job application with the wrong email, and they never get back to you (even though you were certain you were the top pick among the multitude of MAANG folks recently let goโ€”oops, went on a tangent there for a sec ๐Ÿ™‚) โ€” how about simply typing ;em and watching it magically expand into your email?

Why Espanso?

I'm in no way affiliated with them, but kudos must be given where due.

Sure enough, there are tools like TextExpander, but Espanso stands out because it's open source.

Installation

Espanso is cross-platform, with binaries for Windows, Mac, and Linux. I'm sure anyone can find their way around their Installation page: https://espanso.org/install/. If you're on a Mac and using brew, you can also install it from the command line: brew install espanso.

Accessibility

To use Espanso on a Mac, you'll need to grant Accessibility access via System Preferences โ†’ Security & Privacy โ†’ Privacy โ†’ Accessibility.

Configuration

On a Mac, the Espanso config folder usually lives at ~/Library/Application\ Support/espanso. The config folder is for Espanso settings, while the match folder (which contains the base.yml file) is where your triggers and replacements should go.

Example

Just as an example, this is how mine looks like (feel free to take the logic behind emojis):

# espanso match file

# For a complete introduction, visit the official docs at: https://espanso.org/docs/

# You can use this file to define the base matches (aka snippets)
# that will be available in every application when using espanso.

# Matches are substitution rules: when you type the "trigger" string
# it gets replaced by the "replace" string.
matches:
# signatures
  - trigger: ";n"
    replace: "Nikola"

  - trigger: ";b"
    replace: "Breลพnjak"

  - trigger: ";li"
    replace: "https://www.linkedin.com/in/nikola-bre%C5%BEnjak-892b9a24/"

  - trigger: ";sn"
    replace: "Kind regards,\nNikola Breลพnjak\nhttp://www.nikola-breznjak.com/blog"

  - trigger: ";web"
    replace: "http://www.nikola-breznjak.com/"

  - trigger: ";em"
    replace: "nikola.breznjak@gmail.com"

## git
  - trigger: ";ga"
    replace: "git add ."

  - trigger: ";gb"
    replace: "git branch"

  - trigger: ";gc"
    replace: "git commit -m "

  - trigger: ";gd"
    replace: "git diff --color "

  - trigger: ";gf"
    replace: "git fetch --all"

  - trigger: ";gi"
    replace: "find . -name '.DS_Store' -type f -delete"

  - trigger: ";gl"
    replace: "git log"

  - trigger: ";gp"
    replace: "git push origin main"

  - trigger: ";gs"
    replace: "git status"

  - trigger: ";gt"
    replace: "git remote -v"

  - trigger: ";gu"
    replace: "git pull origin main"

## blog
  - trigger: ";bimp"
    replace: "https://nikola-breznjak.com/blog/books/want-improve-read-books/"

  - trigger: ";brem"
    replace: "https://nikola-breznjak.com/blog/miscellaneou/make-remote-developer/"

## emojis
  - trigger: ";eew"
    replace: "โš ๏ธ"

  - trigger: ";eet"
    replace: "๐Ÿค”"

  - trigger: ";eeb"
    replace: "๐Ÿ’ฐ"

  - trigger: ";eem"
    replace: "๐Ÿ’ช"

  - trigger: ";eetm"
    replace: "โ„ข"

  - trigger: ";eeh"
    replace: "โค๏ธ"

  - trigger: ";eeu"
    replace: "๐Ÿ‘"

  - trigger: ";eep"
    replace: "๐Ÿ™"

  - trigger: ";eef"
    replace: "๐Ÿคฆ"

  - trigger: ";ees"
    replace: "๐Ÿ™‚"

  - trigger: ";eeg"
    replace: "๐Ÿ˜Ž"

  - trigger: ";eev"
    replace: "๐Ÿ‘‹"

  - trigger: ";eel"
    replace: "๐Ÿ˜‚"

  - trigger: ";eec"
    replace: "๐Ÿ‘"

  - trigger: ";eeo"
    replace: "โœ…"

  - trigger: ";eer"
    replace: "๐Ÿš€"

  - trigger: ";eex"
    replace: "โญ๏ธ"

## replies
  - trigger: ";ryw"
    replace: "Youโ€™re welcome ๐Ÿ‘"

  - trigger: ";rlmk"
    replace: "Please let me know ๐Ÿ‘"

  - trigger: ";rbtw"
    replace: "Btw, how are things on your end?"

  - trigger: ";rt"
    replace: "Thank you! ๐Ÿ‘"

## misc
  - trigger: ";fd"
    replace: "firebase deploy"

  - trigger: ";wed"
    replace: "Happy Wednesday (a dy on which, historically, most people wed on - thus: Wed nes day). Not really, but it would be a fun fact actually ๐Ÿ™‚"

  - trigger: ";cl"
    replace: "console.log("

  - trigger: ";se"
    replace: "select * from "

  - trigger: ";o"
    replace: "open ."

  - trigger: ";im"
    replace: "![]({{clipb}})"
    vars:
      - name: "clipb"
        type: "clipboard"

  - trigger: ";ch"
    replace: "chrome://history"

  - trigger: ";;c"
    replace: "code ."
Enter fullscreen mode Exit fullscreen mode

Beyond the Basics: Advanced Configurations

As you can see above, you can create simple trigger/replace combinations, but also in example of the ;im trigger to insert an image directly from the clipboard in Markdown format.

They even support plugins, and there's one for all the emojis you'd ever want, and the installation is straightforward.

Conclusion

Espanso is more than a tool; it's a testament to the open-source community's ability to create solutions that are both powerful and accessible. I wholeheartedly recommend you give it a try.

If you're also using Espanso, and have some great tips to share, please leave them in the comments.

Thanks for reading, and hope it was useful ๐Ÿ‘‹

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .