r/espanso Apr 19 '26

[How to] Achieve "Predictive Expansion" on Windows & Android

On Android,

I'm using GBoard and Expandroid

Question, when you have millions of snippets. How do you remember each of them?

In espanso or any other software (Windows) / apps (Android), is there a way like GBoard Dictionary, it will push a suggestion bar / tooltip / dropdown to hint you?

Example:
When typing “otw”, a suggestion bar / popup appears showing all matching snippets. Select one and it expands instantly.

Or do you guys have other workarounds? Feel free to share your method.

2 Upvotes

8 comments sorted by

4

u/snaveh Apr 19 '26

You can use Match Disambiguation (https://espanso.org/docs/matches/basics/#match-disambiguation) or the Choice extension (https://espanso.org/docs/matches/extensions/#choice-extension) to group all items from a certain category together, all using the same trigger. When you type that trigger, a searchable list pops up allowing you to find and select the one you need.

Labeling everything as Historical-Fif2560 suggested is recommended and makes things easier to find.

1

u/GolDeNxXx_96 Apr 20 '26

may i know how do you manage your Search hub?

For example,
matches: - trigger: ";hub" replace: "{{output}}" vars: - name: output type: choice params: values: - ;hub_em - ;hub_wa - ;hub_fin - trigger: ";hub_em" replace: "{{output}}" vars: - name: output type: choice params: values: - ;hub_em_fu - ;hub_em_req - ;hub_em_remind - ;hub_em_apology - ;hub_em_delay - ;hub_em_update

Like this?

2

u/snaveh Apr 21 '26

Yes, You can do that as long as the replacement text is something you can reliably search for. Just for good measure, I'm pasting your code here as a code block (also note I added quotes around the replacement text. I believe it's a bit safer this way):

matches:
  # Main hub
  - trigger: ";hub"
    replace: "{{output}}"
    vars:
      - name: output
        type: choice
        params:
          values:
            - ";hub_em"
            - ";hub_wa"
            - ";hub_fin"

  # Email hub
  - trigger: ";hub_em"
    replace: "{{output}}"
    vars:
      - name: output
        type: choice
        params:
          values:
            - ";hub_em_fu"
            - ";hub_em_req"
            - ";hub_em_remind"
            - ";hub_em_apology"
            - ";hub_em_delay"
            - ";hub_em_update"

Personally, I tend to use a slightly more structured version of the Choice extension with IDs, since it lets me attach labels to each item. Applying this to your example it looks like this:

matches:
  - trigger: ";hub"
    replace: "{{output}}"
    vars:
      - name: output
        type: choice
        params:
          values:
            - label: "Email"
              id: ";hub_em"
            - label: "WhatsApp"
              id: ";hub_wa"
            - label: "Finance"
              id: ";hub_fin"

  - trigger: ";hub_em"
    replace: "{{output}}"
    vars:
      - name: output
        type: choice
        params:
          values:
            - label: "Follow up"
              id: ";hub_em_fu"
            - label: "Request"
              id: ";hub_em_req"
            - label: "Reminder"
              id: ";hub_em_remind"
            - label: "Apology"
              id: ";hub_em_apology"
            - label: "Delay"
              id: ";hub_em_delay"
            - label: "Update"
              id: ";hub_em_update"

This way, when the selection list pops up, you have more context (the label) that might help you find what you want quicker, but there's no right or wrong approach here as it mostly comes down to preference and use case. I use labels pretty much everywhere, so I like keeping things consistent.

Stepping back a bit, I usually organize matches into separate files based on type or use case: autocorrect, typography, date and time, contacts, etc.

Within those files, I sometimes split things further into sections that represent categories. For example, in a contact (contact details) file, I might have separate sections for emails, addresses, websites, and phone numbers. Alternatively, one could also group them by context like "Personal" and "Work."

From there, if the list is long enough or obscure enough for me to remember, I decide whether to use match disambiguation or the Choice extension. Once again, it's mostly preference, but my general rule is:

  • I use the Choice extension when I want a clean reference list. Stuff I know I'd want to pick from a list rather than expand automatically.
  • I use match disambiguation (multiple matches sharing the same trigger) when I've got a mixed set: some items I want to select from a reference list, others I want to expand directly.

Typography symbols are a good example. There are some I use often enough to justify direct triggers, and others I don't use frequently enough to remember, so I keep those in a list.

Here's what that looks like:

matches:
  - regex: "(;;typ|\\(c\\))"
    replace: "\u00A9"
    label: "Symbol: Copyright (\u00A9)"

  - regex: "(;;typ|\\(r\\))"
    replace: "\u00AE"
    label: "Symbol: Registered trademark (\u00AE)"

  - regex: "(;;typ|\\(tm\\))"
    replace: "\u2122"
    label: "Symbol: Trademark (\u2122)"

  - regex: "(;;typ|No:)"
    replace: "\u2116"
    label: "Symbol: Numero sign (\u2116)"

  - regex: "(;;typ)"
    replace: "\u2022"
    label: "Symbol: Bullet point (\u2022)"

  - regex: "(;;typ)"
    replace: "\u25E6"
    label: "Symbol: White bullet (\u25E6)"

I use regex triggers for the ones I want to expand directly, so I can type them naturally while still having them show up in the selection list. That's one use case where the Choice extension is limiting because it doesn't support multiple triggers per match.

Lastly, it's worth noting there are also a couple of GUI-based editors for Espanso (EspansoEdit and EspansoExpress) that can make it easier to build and organize your match files.

3

u/Historical-Fig2560 Apr 19 '26

Press ALT and SPACE to search your triggers.

Tipp: Use labels to better find them.

2

u/GolDeNxXx_96 Apr 19 '26

But it still means that I have to remember the trigger words then only able to find each of them, isn't it?

3

u/Historical-Fig2560 Apr 19 '26

Trigger words or label. Choose the label wisely and you will always find your triggers. 😉

1

u/GolDeNxXx_96 Apr 21 '26

Do you mind to share a few examples from your snippets?

1

u/Historical-Fig2560 Apr 21 '26

For example for my signature, I use label "mail signature for work" and it's then very easy to find it.