espanso

espanso – smart and efficient text expander

In Operation

espanso is automatically started when you power up your computer.

espanso works by detecting your keypresses and replacing them when they match a specific keyword, called a trigger.

Here’s a very short video showing espanso in action.

The video includes some emojis. We needed to install the basic-emojis package and restart espanso for the changes to take effect with the commands:

$ espanso install basic-emojis
$ espanso restart

The emojis don’t display with some terminals including hyper.

What else does espanso offer?

It works with images, supports forms, and offers file based configuration. The ability to support forms lets you create matches with many arguments. There’s also a passive mode. This lets you expand matches after typing instead of in realtime as the examples in the video show. Passive mode lets the software easily analyse whole sentences and execute a complex elaboration. But this functionality can be actioned using forms, so the author is considering the removal of passive mode.

There’s a built-in package manager for espanso hub too, together with app-specific configurations.

espanso uses a file-based configuration approach, following the Unix philosophy. On our Linux systems, this file is stored in ~/.config/espanso/default.yml. The file default.yml is the program’s default configuration file. We’ve reproduced the unedited file below. Changes made to the file are automatically detected by espanso.

# espanso configuration file

# This is the default configuration file, change it as you like it
# You can refer to the official documentation:
# https://espanso.org/docs/

# Matches are the substitution rules, when you type the "trigger" string
# it gets replaced by the "replace" string.
matches:
  # Simple text replacement
  - trigger: ":espanso"
    replace: "Hi there!"

  # Dates
  - trigger: ":date"
    replace: "{{mydate}}"
    vars:
      - name: mydate
        type: date
        params:
          format: "%m/%d/%Y"

  # Shell commands
  - trigger: ":shell"
    replace: "{{output}}"
    vars:
      - name: output
        type: shell
        params:
          cmd: "echo Hello from your shell"

Next page: Page 3 – Summary

Pages in this article:
Page 1 – Introduction / Installation
Page 2 – In Operation
Page 3 – Summary

Share this article

Share your Thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.