Having pre-defined user snippets would enable us to introduce Roam style commands to Foam. Consider the below snippets:
{
"Zettelkasten Id": {
"scope": "markdown",
"prefix": "/id",
"description": "Zettelkasten Id",
"body": [
"${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}"
]
},
"Current date": {
"scope": "markdown",
"prefix": "/date",
"description": "Current date",
"body": [
"${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}"
]
}
}
Which would look like:
Using snippets enables Foam users to add [custom-snippets] themselves so they live alongside the first-class /commands
.
/
to trigger a command menu. Experienced VS Code users may be more likely to favour the command palette.TabCompletionProvider
and snippets
and mix them (maybe) via the following VS Code setting: "editor.snippetSuggestions": "inline" | "top" | "bottom" | "none"
Some markdown syntax is difficult for users who have never authored markdown before. Take for example a checkbox/todo. The following syntax is required:
- [ ] Something todo...
We could provide snippets that expand out into the associated markdown syntax, like in the below GIF:
The JSON for these snippets can be found here.