Skip to content

Commit

Permalink
Add espanso example config
Browse files Browse the repository at this point in the history
  • Loading branch information
zerowidth committed Jul 4, 2023
1 parent 547112c commit 1bbf913
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,42 @@ The sanitized issue title can be used for filenames. In a templater template for

### Auth issues

If you're using a recent version of the GitHub CLI that uses the system keychain to store credentials, these helper functions may not work. If so, you can prepend the `PATH` to the user functions:
If you're using a recent version of the GitHub CLI that uses the system keychain to store credentials, these helper functions may not work. If so, you can configure the `PATH` in the user functions. This assumes you've installed the GH CLI with homebrew:

- `PATH=$PATH:/opt/homebrew/bin /opt/homebrew/bin/gh md link -n "$input"`
- `PATH=$PATH:/opt/homebrew/bin /opt/homebrew/bin/gh md title -n --sanitize "$input"`

## Using `gh-md` with [Espanso](https://espanso.org)

An espanso config for generating links and references from the clipboard:

```yaml
matches:
- trigger: "//md"
replace: "{{output}}"
vars:
- name: clipboard
type: clipboard
- name: output
type: shell
params:
cmd: "gh md link {{clipboard}}"
- trigger: "//ml"
replace: "{{output}}"
vars:
- name: clipboard
type: clipboard
- name: output
type: shell
params:
cmd: "gh md link --simple {{clipboard}}"
- trigger: "//ir"
replace: "{{output}}"
vars:
- name: clipboard
type: clipboard
- name: output
type: shell
params:
cmd: "gh md ref {{clipboard}}"
```

0 comments on commit 1bbf913

Please sign in to comment.