This plugin allows you to add custom URI commands to the command palette. Can be used with the Obsidian URI scheme, as well as any other URI scheme your computer supports.
You can use the placeholders below in your URI. All of these are URL-encoded for you unless you turn off URL-encoding, so you don't need to worry about your text having any unescaped illegal or reserved characters.
All commands with placeholders are hidden when there is no active file.
| Placeholder | Description | |
|---|---|---|
| {{fileName}} | Just the base name of the file, without the filepath or file extension. | |
| {{filePath}} | Path, relative to the vault, to the current file. E.g. FolderName/filename.md |
|
| {{fileText}} | Entire contents of the file, including frontmatter. Available only in markdown files. | |
| {{selection}} | Your current selection. If nothing is selected, placeholder is replaced by the empty string. | |
| {{line}} | Current line. | |
| {{vaultName}} | Name of the current vault. | |
| {{meta:FIELD_NAME}} | The value of the metadata field corresponding to FIELD_NAME. Note that if there are multiple values in one field (as a comma-separated list or [array]), the values in the field will be inserted in the URI as a comma-separated list. Requires MetaEdit. |
work vault: obsidian://open?vault=work%20vaulthotkey reference in the vault my vault: obsidian://open?vault=my%20vault&file=hotkey%20referenceobsidian://advanced-uri?vault=&daily=true&data={{selection}}&mode=appendobsidian://goto-plugin?id=uri-commands&show=configmailto:[email protected]?subject={{fileName}}&body={{fileText}}mailto:[email protected]?subject={{fileName}}&body={{fileText}}spotify:album:4niKC11eq7dRXiDVWsTdEyhttps://hackmd.io/newhttps:// or http://, not www.https://en.wikipedia.org/wiki/{{meta:topic}}calibre://search/_?q={{selection}}{{meta:external-link}}For more information on URIs in Obsidian, see the Obsidian documentation. An incomplete list of other URI schemes can be found here.
Parts of this code, especially the icon picker, borrow heavily from phibr0's plugins, including Obsidian Macros and Customizable Sidebar.