Code Snippets
Code Snippets are closely related to Templates, but instead of defining the content of an entire note, a snippet is a reusable piece of code that can easily be inserted into a Code note.
Creating a Code snippet
In the Note Tree:
- Right-click the note where you want to place the snippet.
- Select Insert child note.
- Select More → Code snippet.
Then simply type the desired code into the note and set the correct language mode.
The note's title becomes the title of the snippet. Optionally, you can add a description in the Promoted Attributes section.
Inserting a snippet
To insert a snippet, type / followed by the first letters of its title, then select it from the list. Typing /snippet lists every snippet available in the note. This also works in an included code or Markdown note that is being edited in place, see Include Note.