Foam

Pre-defined User Snippets

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: GIF demonstrating User Snippets

Using snippets enables Foam users to add [custom-snippets] themselves so they live alongside the first-class /commands.

Notes & Considerations

Simplifying Markdown Syntax

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: GIF demonstrating markdown snippets

The JSON for these snippets can be found here.