✅ Overview

The document template system provides yasnippet/skeleton-like functionality for quickly creating new documents or inserting pre-defined content. Templates support:

  • Multiple formats: Org-mode, Markdown, and LaTeX

  • Tab stops for quick navigation between placeholders

  • Auto-fill variables for dates, author, filenames, etc.

  • User-defined templates stored in a configurable directory

  • Built-in templates for common document types

✅ Quick Start

Insert a Template

  1. Open a file (org, markdown, or latex)

  2. Press C-c T i or run Scimax: Quick Insert Template

  3. Select a template from the list

  4. Tab through placeholders to fill in values

Create a New File from Template

  1. Press C-c T n or run Scimax: New File from Template

  2. Select a template

  3. Enter the filename

  4. The file is created and opened with the template content

✅ Access via Hydra Menu

Press C-c C-m (Hydra menu), then t for Templates submenu.

✅ Built-in Templates

✅ Org-mode Templates

TemplateDescription
ArticleBasic article with title, author, and sections
Research NotesProblem, approach, experiments, results
Meeting NotesAttendees, agenda, discussion, action items
Project PlanGoals, milestones, tasks, risks
Literature ReviewPaper review with key contributions, methods
Source BlockCode block with language selection

Custom Exporter Templates

Every loaded custom exporter also contributes an org template, listed under the Custom Exporters category and named after the exporter. Inserting it writes the header that exporter needs -- for the CMU Memo example:

#+TITLE: Memo subject
#+AUTHOR: ...
#+DATE: 2026-09-02
#+LATEX_CLASS: cmu-memo

#+DEPARTMENT: Department of Chemical Engineering
#+TO: <<<TO>>>
#+FROM: ...
#+SUBJECT: Memo subject

Defaults from the manifest are filled in and required keywords appear as <<<PLACEHOLDER>>>. Scimax: Insert Custom Exporter Header does the same thing from the export side, and exporting with a required keyword missing offers it.

✅ Markdown Templates

TemplateDescription
READMEStandard project README
Blog PostBlog post with frontmatter
Technical DocumentationStep-by-step technical documentation

✅ LaTeX Templates

TemplateDescription
ArticleLaTeX article with standard preamble
Beamer PresentationBeamer slide deck
LetterFormal letter template
EquationNumbered equation environment
FigureFigure environment with caption
TableTable environment with caption

Snippets

Short prefixes expand into org syntax when you press Tab right after them: type ti and Tab for #+TITLE:, or <py and Tab for a Python source block. Tab stops then move through the parts to fill in (Tab to go on, Escape to finish). The snippets also appear in the suggestion list as you type.

Tab expands them because scimax sets editor.tabCompletion to onlySnippets for org files: Tab expands a word only when it is exactly a snippet's prefix, and inserts a tab otherwise. On a heading, list item or table, Tab keeps its org meaning (fold, indent, next cell). To turn expansion on Tab off, add this to your settings:

"[org]": { "editor.tabCompletion": "off" }
PrefixInserts
<shShell source block
<bashBash source block
<pPython source block
<pyPython source block
<jpJupyter Python source block
<jjJupyter Julia source block
<jrJupyter R source block
<jsJavaScript source block
<tsTypeScript source block
<elEmacs Lisp source block
<elispEmacs Lisp source block
<rbRuby source block
<rR source block
<jlJulia source block
<sqlSQL source block
<lLaTeX source block
<cC source block
<cppC++ source block
<javaJava source block
<goGo source block
<rsRust source block
<sSource block with language prompt
<eExample block
<qQuote block
<centerCenter block
<commentComment block
<vVerse block
<htmlHTML export block
<latexLaTeX export block
<noteNote block
<warningWarning block
<tipTip block
<propProperty drawer
<iInline source code
tiDocument title keyword
caCaption keyword for figures/tables

The snippets live in snippets/org.json in the extension. To add your own, run Snippets: Configure Snippets (Preferences: Configure Snippets) and choose org.

✅ Template Syntax

✅ Tab Stops

Tab stops mark positions where the cursor should stop when pressing Tab:

${1:First placeholder}
${2:Second placeholder}
$0  # Final cursor position

After inserting, press Tab to move between placeholders.

✅ Auto-fill Variables

These variables are automatically replaced when the template is inserted:

VariableDescription
{{date}}Current date (configurable format)
{{time}}Current time (configurable format)
{{datetime}}Date and time combined
{{year}}Current year (yyyy)
{{month}}Current month (MM)
{{day}}Current day (dd)
{{weekday}}Full day name (e.g., "Monday")
{{timestamp}}ISO 8601 timestamp
{{author}}Configured author name
{{user}}System username
{{filename}}Current file name (without extension)
{{filepath}}Full path to current file
{{directory}}Directory containing current file
{{workspace}}Workspace folder name
{{workspacePath}}Full workspace path
{{uuid}}Random UUID

✅ Named Variables

Named variables prompt the user for input:

${title}           # Prompts for "title"
${title:Default}   # Prompts with default value

✅ Creating User Templates

✅ Template Directory Structure

User templates are stored in ~/scimax/templates by default (under scimax.directory). You can override this with scimax.templates.directory:

~/scimax/templates/
├── org/
│   ├── my-article.org
│   └── weekly-report.org
├── markdown/
│   └── project-proposal.md
└── latex/
    └── thesis-chapter.tex

Template File Format

Templates can include metadata in header comments:

The metadata block must be the first thing in the file and is terminated by a blank line. Everything after that blank line is template content, so an org template can begin with real keywords (#+TITLE:, #+AUTHOR:, #+TO: ...) without them being mistaken for template metadata.

Recognized metadata keys are NAME, DESCRIPTION, CATEGORY, FILENAME (or DEFAULTFILENAME), and FORMAT. A leading block that contains none of these is treated as document content and is kept in the template; its TITLE is still used to name the template when NAME is absent.

✅ Org-mode Template

#+NAME: Weekly Report
#+DESCRIPTION: Weekly status report template
#+CATEGORY: Work

* Week of {{date}}
** Accomplishments
- ${1:Accomplishment 1}

** Next Week
- ${2:Plan 1}

** Blockers
${3:None}
$0

✅ Markdown Template

<!-- NAME: Project Proposal -->
<!-- DESCRIPTION: Proposal for new projects -->
<!-- CATEGORY: Work -->

# ${1:Project Name}

## Overview
${2:Brief description}

## Goals
- ${3:Goal 1}

$0

✅ LaTeX Template

% NAME: Thesis Chapter
% DESCRIPTION: Chapter template for thesis
% CATEGORY: Academic

\chapter{${1:Chapter Title}}
\label{chap:${2:label}}

${3:Introduction paragraph}

\section{${4:Section Title}}
$0

Create Template from Selection

  1. Select text in the editor

  2. Press C-c T s or run Scimax: Create Template from Selection

  3. Enter a name for the template

  4. Optionally add a description

  5. The template is saved to your templates directory

Commands

CommandKeybindingDescription
scimax.templates.quickInsertC-c T iInsert template (auto-detect format)
scimax.templates.insertInsert any template
scimax.templates.insertOrgInsert org-mode template
scimax.templates.insertMarkdownInsert markdown template
scimax.templates.insertLatexInsert LaTeX template
scimax.templates.newFileC-c T nCreate new file from template
scimax.templates.newOrgFileCreate new org file from template
scimax.templates.newMarkdownFileCreate new markdown file
scimax.templates.newLatexFileCreate new LaTeX file
scimax.templates.listC-c T lList all templates
scimax.templates.createFromSelectionC-c T sCreate template from selection
scimax.templates.editTemplatesOpen templates in VS Code
scimax.templates.openDirectoryOpen templates dir in file explorer
scimax.templates.reloadReload templates from disk
scimax.export.insertExporterHeaderInsert a custom exporter's org header

✅ Configuration

SettingDefaultDescription
scimax.templates.directory{scimax.directory}/templatesDirectory for user templates
scimax.templates.defaultFormatorgDefault format for new templates
scimax.templates.dateFormatyyyy-MM-ddDate format (date-fns)
scimax.templates.timeFormatHH:mmTime format (date-fns)
scimax.templates.author(system user)Author name for {{author}} variable

✅ Date Format Reference

The date and time formats use date-fns format strings:

PatternDescriptionExample
yyyyFull year2024
yy2-digit year24
MMMonth (2 digits)01-12
MMMMonth abbreviationJan
MMMMFull month nameJanuary
ddDay (2 digits)01-31
EEEEFull day nameMonday
EEEDay abbreviationMon
HHHour (24h)00-23
hhHour (12h)01-12
mmMinutes00-59
ssSeconds00-59

✅ Hydra Menu

The template system has a dedicated Hydra submenu accessible from the main menu (C-c C-m t):

KeyAction
iInsert template
oInsert org template
mInsert markdown
xInsert LaTeX
nNew file
ONew org file
MNew markdown file
XNew LaTeX file
lList all templates
sSave selection
eEdit templates
dOpen directory
rReload templates

✅ Tips and Workflows

✅ Project-Specific Templates

Create a .scimax-templates directory in your project for project-specific templates:

my-project/
├── .scimax-templates/
│   └── org/
│       └── experiment-notes.org
├── src/
└── docs/

Then configure scimax.templates.directory in your workspace settings.

✅ Template Libraries

Share templates across projects by:

  1. Creating a Git repository for your templates

  2. Cloning it to ~/scimax/templates (or your configured templates directory)

  3. Pulling updates when templates change

✅ Combining with Capture

Templates and capture serve different purposes:

  • Templates: Create complete documents or insert large content blocks

  • Capture: Quick notes appended to existing files

Use templates for new documents, capture for quick additions.