Last active
July 27, 2020 08:35
-
-
Save regendo/742e10df9d1f4cc58e8033ef5b5a27de to your computer and use it in GitHub Desktop.
Bear config file for espanso. Put it into `~/Library/Preferences/espanso/user`. Requires urlencode: https://github.com/dead10ck/urlencode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: bear | |
parent: default | |
matches: | |
# Footer | |
- trigger: ":bfoot" | |
# Multi-Line string that keeps newlines and adds one at the end. | |
# Syntax highlighters might interpret the markdown headings as YAML comments, like this one. This is incorrect; YAML understands that these are part of the multi-line string data. | |
replace: | | |
--- | |
## Metadata | |
Created on {{timestamp}}. | |
### What links here? | |
References to [{{clipboard}}](bear://x-callback-url/search?term={{urlencode}}) | |
### Additional References | |
### Additional Tags | |
vars: | |
- name: timestamp | |
type: date | |
params: | |
format: "[[%B %d, %Y]] (%A) at %I:%M %p" | |
- name: clipboard | |
type: clipboard | |
- name: urlencode | |
type: shell | |
params: | |
cmd: echo '"'$(pbpaste)'"' | $HOME/.cargo/bin/urlencode | |
trim: true | |
# Search Link | |
- trigger: :blink | |
replace: "[{{clipboard}}](bear://x-callback-url/search?term={{urlencode}})" | |
vars: | |
- name: clipboard | |
type: clipboard | |
- name: urlencode | |
type: shell | |
params: | |
cmd: echo '"'$(pbpaste)'"' | $HOME/.cargo/bin/urlencode | |
trim: true | |
- trigger: ":bdate" | |
# Because each bear note already starts with the `#` H1 tag, we omit it from the title. | |
replace: |- | |
{{title}} | |
--- | |
## Metadata | |
### What links here? | |
References to [{{title}}](bear://x-callback-url/search?term={{urlencode}}) | |
### Additional References | |
### Additional Tags | |
#journal/daily | |
vars: | |
- name: title | |
type: date | |
params: | |
format: "%B %d, %Y" | |
- name: urlencode | |
type: shell | |
params: | |
cmd: date +"%B %d, %Y" | $HOME/.cargo/bin/urlencode | |
trim: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Workflow:
:blink
to create a "what links here" style backlink at the cursor's location, or type:bfoot
to create a whole footer, including that link.