The plugin allows to use templates stored inside your vault as text snippets.
- Create a folder with templates inside your vault or select an existing one.
- Use
Ctrl/Cmd + P
to open the command palette and selectMicro temlates: select source folder
(or set it manually in the plugin settings). - Then, use
Ctrl/Cmd + P
to open the command palette and selectMicro temlates: insert template
anywhere you want.
The plugin uses ejs template engine to compile templates. It means that you can use any javascript code inside your templates.
Additionaly it provides dayjs to use it as is right in the templates:
<%= d().format("YYYY-MM-DD") %>
Use $cur
marker string to mark place where cursor should be placed after template insertion:
This is a template cursor should be between these [ $cur ] bkackets.