Espanso: user/*.yml loaded, parsed but not applied

Created on 22 Feb 2020  路  6Comments  路  Source: federico-terzi/espanso

Hi,

outstanding software. One can feel the passion, dedication and attention to detail in the way espanso works, is presented on its website and so on ... Thank you!

I want to categorize my expansions in multiple files. For example I created a user/mail.yml with the same structure as the default.yml, but the containing replacements do not work.

I can verify the the file is loaded by deliberately placing faulty yaml syntax into it. Then espanso complains when executing espanso restart

Is there something I am missing? All custom replacements in default.yml work just fine.

I am on Pop!_OS 19.10 and installed it with the ubuntu/debian deb-file instructions.

Thanks in advance!

Cheers!

documentation enhancement

All 6 comments

Hey @owzim,

Thank you for the kind words! I totally understand your point, as I split my matches on multiple files as well to organize them better.

The first step is to create your additional config files in the user/* directory as you did. The important thing to keep in mind is to add the parent: default parameter, which tells espanso to merge the current matches in the default.yml ones.

Here's an example of my user/emails.yml file:

name: emails
parent: default

matches:
  - trigger: ":reg"
    replace: |
        Best Regards,
        Federico Terzi

Let me know if you have other dubts.

Cheers :)

Thanks! That works like a charm. Is this mentioned in the docs somewhere? Can't find it. Additionally, why is the parent: default declaration necessary? Does not seems intuitive to me. Since it does not depend on or inherits from the default.yml at all. It's separate. what would other values be, and with what effect? If parent: default is the default, then maybe make it optional?

Hey @owzim,
Now that you've pointed it out, I realized I never wrote anything about it in the docs!
I'll try to add a few instructions as soon as I have some time.

Additionally, why is the parent: default declaration necessary? Does not seems intuitive to me. Since it does not depend on or inherits from the default.yml at all.

I understand that without any explanation it could look strange. In a nutshell, espanso merges all children matches into their parent at startup, and declaring parent: default indicates that the following matches should be merged into the default.yml file.

It doesn't set parent: defaultby default as configs in the user/* directory can also be used for app-specific configurations, which must be separate to the default one.

Cheers :)

Hey,
I'm closing the issue as I added a section to the docs.
Cheers :)

I was going to create an issue about this as I encountered the same problem. It's not explicit that we have to insert this option and the other usage other than parent: default is not documented.

I haven't tried it but I think that's it:

# ./user/telegram.yml
filter_title: "Telegram"

matches:
  - trigger: ":ok"
    replace: "馃憤"

# ./user/another.yml
parent: telegram

matches:
  - trigger: ":lol"
    replace: "馃槀"

It could be great to add an additional example, even small.

I was going to create an issue about this as I encountered the same problem. It's not explicit that we have to insert this option and the other usage other than parent: default is not documented.

I haven't tried it but I think that's it:

# ./user/telegram.yml
filter_title: "Telegram"

matches:
  - trigger: ":ok"
    replace: "馃憤"

# ./user/another.yml
parent: telegram

matches:
  - trigger: ":lol"
    replace: "馃槀"

It could be great to add an additional example, even small.

There is a small example in the docs, but not for this particular case.

I'll make sure to document it #274 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

herrowna picture herrowna  路  5Comments

Adam13531 picture Adam13531  路  7Comments

oceanbyte-deprecated picture oceanbyte-deprecated  路  7Comments

matheusfillipe picture matheusfillipe  路  6Comments

Tzahreddin picture Tzahreddin  路  3Comments