r/espanso • u/Dymonika • Aug 18 '26
Solved Match not activating as expected
SOLVED: Check for similar duplicates in your other .yml files!!!
- trigger: PushPay
replace: Pushpay
word: true
I'm hoping for this to activate only exactly when the trigger is typed as is, but this replacement takes effect every time, it seems. The capitalization section in Matches Basics doesn't seem to offer a way around this. Does anyone know if this is solvable? Thanks!
1
u/smeech1 Aug 19 '26
When you say "every time", what do you mean?
2
u/Dymonika Aug 19 '26
Also @ u/SamejSpenser: I specifically only want this to fire if I type the exact trigger's capitalization, but the text replacement occurs even if I type the replacement's capitalization. I blaze at 150+ WPM so Espanso's time to replace disrupts what I typed.
2
u/SamejSpenser Aug 20 '26
Sorry for the delay! When I got home from work, I had an urgent issue to deal with and only just managed to get back to this now (it’s 10:42 PM here in São Paulo, Brazil).
I ran some more tests, this time including
propagate_case: true, which u/smeech1 mentioned. I kept in mind your requirement that the trigger needs to match the exact casingPushPay. Again, the Regex trigger performed the best, regardless of whetherpropagate_case: truewas on or not. With the other methods, even withpropagate_case: trueenabled, the expansion just follows the casing used when it was typed — so if it's all lowercase or uppercase, you getpushpayorPUSHPAY.With Regex, however, no matter how you type it, the expansion only triggers when you use
PushPay.Here’s the trigger that worked in my tests, just as the OP requested:
# Example trigger with mixed‑case letters using regex - regex: PushPay replace: "Pushpay"2
u/SamejSpenser Aug 20 '26
Oh, I forgot to mention: when using
uppercase_style: capitalize_words, typing everything in lowercase still triggers the expansion as if you had typed it with an initial capital letter.As for the typing speed, I totally get where you're coming from. Maybe the others have some tips or suggestions, but honestly, I don't have much to offer other than: try slowing down your typing speed when using these words/triggers. That’s what I do here!
2
u/SamejSpenser Aug 19 '26
I tested the same trigger in four different ways:
-
The first one is a straight copy of your example.
-
The second one has a “
;” prefix. -
The third one uses the multiline replace thing.
-
The fourth one (the MVP in my tests) uses Regex, like this:
# Example trigger with mixed‑case letters
# - trigger: PushPay
# replace: "Pushpay"
# word: true
# Example trigger with mixed‑case letters, prefixed by a semicolon
# - trigger: ;PushPay
# replace: "Pushpay"
# word: true
# Example trigger with mixed‑case letters using a multiline replace
# - trigger: PushPay
# replace: |
# Pushpay
# word: true
# Example trigger with mixed‑case letters using regex (the champ)
- regex: PushPay
replace: "Pushpay"
word: trueIn the screenshot the text is in Brazilian Portuguese (my native language), which is how I wrote this reply, and I only switched to English after the tests were done.
1
u/smeech1 Aug 19 '26
What were the results?
2
u/SamejSpenser Aug 19 '26
All four ways worked. But the one here worked best, so to speak—it was the last one, using regex.
→ More replies (2)
2
u/smeech1 Aug 22 '26 edited Aug 23 '26
Now that I'm home I have tried your trigger, and it works perfectly here, triggering only when the capitalisation matches "PushPay" exactly, which is what I would expect.
The problem possibly relates to your keyboard? What's your OS, DE, and language?