Skip to content
Create vscode templates for MkDocs

Create vscode templates for MkDocs

Create templates to use when creating a new MkDocs document

Also, for more info see: Multible Templates

Using vscode

You’re right - we’ve circled back. Let’s stop tweaking settings.json and use a different, simpler approach that always works. Solution: Command Palette + Manual Trigger (100% Reliable)

Delete settings.json entirely - no more settings fights. Step-by-Step (Works Immediately)

Keep your markdown.json snippet as-is in .vscode/markdown.json

Open any .md file

Press Ctrl+Shift+P → type "Insert Snippet" → Enter

Your guides snippet appears in the dropdown → select it

Snippet inserts at cursor

Even Better: Assign Keyboard Shortcut

Add this to .vscode/keybindings.json (create if needed):

json
[
  {
    "key": "ctrl+shift+g",
    "command": "editor.action.insertSnippet",
    "args": { "snippet": "${fileBasenameNoExtension} guides template" },
    "when": "editorLangId == markdown"
  }
]

Now Ctrl+Shift+G → instantly inserts your guides snippet. Why This Wins

No settings conflicts

Works in every VS Code version

Team members get it immediately

No autocomplete popup wars

The Command Palette approach is actually VS Code’s recommended workflow for snippets when auto-trigger gets finicky. Your guides template is now accessible via one shortcut anywhere in any .md file.

Want to test? Ctrl+Shift+P → “Insert Snippet” → guides → done. No more circles. No. Our ‘snippet’ doesn’t appear in the dropdown

The snippet not appearing in “Insert Snippet” dropdown means VS Code is not detecting your .vscode/markdown.json file properly. Quick Diagnostic & Fix

  1. Verify exact file structure:

text your-mkdocs-project/ ├── docs/ ├── mkdocs.yml └── .vscode/ ← Must be here, at ROOT level └── markdown.json ← Exact name, lowercase, .json extension

  1. Validate markdown.json format (copy-paste this exactly):

json { “MkDocs Guides”: { “prefix”: “guides”, “body”: [ “—”, “title: ${1:Guide Title}”, “status: new”, “description: ${2:Short description}”, “—”, “”, “# ${1:this:Guide Title}”, “”, “Content here…” ], “description”: “MkDocs guides template” } }

  1. Force VS Code to reload snippets:

    Ctrl+Shift+P → “Snippets: Reload Snippets” (if available)

    OR close/reopen the entire VS Code window

  2. Test via Command Palette:

    Ctrl+Shift+P → “Insert Snippet”

    Look for “MkDocs Guides” (the snippet name, not the prefix)

Nuclear Option (Always Works)

If still missing, create global snippets instead:

Ctrl+Shift+P → "Configure User Snippets" → "markdown.json"

VS Code opens ~/.config/Code/User/snippets/markdown.json

Paste your exact snippet there

Save → now appears everywhere

The .vscode/markdown.json approach works 95% of the time - if it’s not detected, it’s almost always:

Wrong folder (must be project root .vscode/)

Typo in filename (must be markdown.json)

JSON syntax error (missing comma/quote)

Try the global user snippets as backup - zero chance of failure. At last! It works! Why didn’t we start here to begin with, or why do this ‘global’ approach work, but not the other suggestions?

Great! The global user snippets (Ctrl+Shift+P → “Configure User Snippets”) work reliably because: Why Global Works, Workspace Doesn’t

  1. VS Code Priority Order:

text Global User Snippets (User/) ← ALWAYS loaded first ✅ Workspace Snippets (.vscode/) ← Loaded second, often ignored/broken ❌

  1. Workspace .vscode/markdown.json Problems:

    Detection is flaky - VS Code sometimes doesn’t scan .vscode/ until specific conditions

    Language association - Markdown snippets in .vscode/ need exact workspace matching

    Reload timing - Workspace changes require full window reload + cache clear

    Extension conflicts - Markdown extensions (MkDocs, etc.) override workspace snippets

  2. Global is “Bulletproof”:

    Loaded at VS Code startup

    Always detected by language server

    No workspace dependencies

    Works across all projects

The Real VS Code Workflow

Microsoft’s official recommendation (from docs):

Use global user snippets for reusable templates (like your MkDocs guides)

Use workspace snippets only for project-specific, rarely-used snippets

Use Command Palette → Insert Snippet as primary access method

We fought the workspace approach because it’s finicky by design. Global user snippets are the production-ready solution everyone actually uses.

Your guides template is now available in EVERY markdown file, every project - perfect for MkDocs work!

Pro tip: Ctrl+Shift+P → “Insert Snippet” → guides is now muscle memory. Fastest workflow possible. 🎉