Skip to content

Instantly share code, notes, and snippets.

@Mara-Li
Last active July 30, 2024 05:44
Show Gist options
  • Save Mara-Li/d62c884ad0bc12ca87e030074321a48b to your computer and use it in GitHub Desktop.
Save Mara-Li/d62c884ad0bc12ca87e030074321a48b to your computer and use it in GitHub Desktop.
#Have this script directly into your espanso/user.
# You can change and add some triggers too !
# To use it, it's simply the trigger (: or /) before all aliases for the admonition.
# For example : :faq or /faq will type the admonition question.
filter_title: "Obsidian"
matches:
#Title
- triggers: [":note", ":seealso"]
replace: |
```ad-note
title: $|$
```
- triggers: [":tldr",":summ", ":summary"]
replace: |
```ad-abstract
title: $|$
```
- triggers: [":info",":todo"]
replace: |
```ad-info
title: $|$
```
- triggers: [":tip", ":hint", ":important", ":def"]
replace: |
```ad-tip
title:$|$
```
- triggers: [":success", ":suc", ":check",":done"]
replace: |
```ad-success
title: $|$
```
- triggers: [":question", ":help",":faq"]
replace: |
```ad-question
title: $|$
```
- triggers: [":warn", ":warning", ":caution", ":attention"]
replace: |
```ad-warning
title: $|$
```
- triggers: [":failure", ":fail", ":missing", ":miss"]
replace: |
```ad-failure
title: $|$
```
- triggers: [":danger", ":error"]
replace: |
```ad-danger
title: $|$
```
- trigger : ":bug"
replace: |
```ad-bug
title: $|$
```
- triggers: [":ex", ":example"]
replace: |
```ad-example
title:$|$
```
- triggers: [":quote",":cite"]
replace: |
```ad-quote
title: $|$
```
#Content
- triggers: ["/note", "/seealso"]
replace: |
```ad-note
$|$
```
- triggers: ["/tldr","/summ", "/summary"]
replace: |
```ad-abstract
$|$
```
- triggers: ["/info","/todo"]
replace: |
```ad-info
$|$
```
- triggers: ["/tip", "/hint", "/important", "/def"]
replace: |
```ad-tip
$|$
```
- triggers: ["/success", "/suc", "/check","/done"]
replace: |
```ad-success
$|$
```
- triggers: ["/q","/question", "/help","/faq"]
replace: |
```ad-question
$|$
```
- triggers: ["/warn", "/warning", "/caution", "/attention"]
replace: |
```ad-warning
$|$
```
- triggers: ["/failure", "/fail", "/missing", "/miss"]
replace: |
```ad-failure
$|$
```
- triggers: ["/danger", "/error"]
replace: |
```ad-danger
$|$
```
- trigger : "/bug"
replace: |
```ad-bug
$|$
```
- triggers: ["/ex", "/example"]
replace: |
```ad-example
$|$
```
- triggers: ["/quote","/cite"]
replace: |
```ad-quote
$|$
```
@Mara-Li
Copy link
Author

Mara-Li commented May 15, 2021

Installation instruction

→ The file is configured to work only in Obsidian (via the filter_title).
To make it work, you need to put it in the perso folder which should be (by default) :

  • On Windows: %appdata%\espanso
  • On MacOS: $HOME/Library/Preferences/espanso
  • On Linux: $XDG_CONFIG_HOME/espanso

You can get the path to the config path using the espanso path command.

(For more information, see espanso help
After that, espanso will recognize Obsidian, and you can use the shortcuts.

If you want to use it in all programs, you can :

  • Put it after the default.yml file. In this case, you must remove the first two lines of the file, namely: filter_title: "Obsidian" and matches.
  • Put it in a single file, in this case, as before, you have to put it in the perso folder and add the following lines:
name: Admonition #You can custom it
parent: default

Furthermore, you can also put it after another file, which is fixed on Obsidian. In this case, the parent should be your first obsidian file.

For more information, you can consult the official espanso site on configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment