This guide will help you create custom Markdown snippets in VS Code on Linux, allowing you to quickly insert templates (like your daily checklist) with a simple keyword.
- Launch VS Code.
- Open the Command Palette:
- Shortcut:
Ctrl + Shift + P
- Shortcut:
- Search for:
Preferences: Configure User Snippets - Select
markdown.json(for Markdown-specific snippets).- If it doesn’t exist, VS Code will create it.
Replace the contents of markdown.json with:
{
"Daily Checklist": {
"prefix": "checklist",
"body": [
"# 📅 Daily Checklist",
"## ⏰ Date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE}",
"1. [ ] Priority task #1",
"2. [ ] Important task #2",
"3. [ ] Optional task #3",
"### ✅ Completed",
"- ~~Example task~~",
"### 📦 Postponed",
"- [ ] Postponed task (reason: ...)",
"### 💡 Notes",
"- Space for comments."
],
"description": "Template for a daily task checklist in Markdown"
}
}| Field | Purpose |
|---|---|
"prefix" |
The shortcut word (e.g., typing checklist + Tab will insert the snippet). |
"body" |
The actual template (supports multi-line text and placeholders like ${CURRENT_DATE}). |
"description" |
Help text shown in autocomplete. |
- Open or create a Markdown file (
Ctrl + N→ save asfile.md). - Type the prefix (
checklist). - Press
Tabto auto-insert the template.
✅ Expected Result:
# 📅 Daily Checklist
## ⏰ Date: 2023-11-15
1. [ ] Priority task #1
2. [ ] Important task #2
3. [ ] Optional task #3
### ✅ Completed
- ~~Example task~~
### 📦 Postponed
- [ ] Postponed task (reason: ...)
### 💡 Notes
- Space for comments.- Fix 1: Ensure the file has a
.mdextension. - Fix 2: Reload VS Code (
Ctrl + Shift + P→Developer: Reload Window). - Fix 3: Check JSON syntax (no trailing commas in
bodyarray).
- If
${CURRENT_DATE}doesn’t work, install the "Text Power Tools" extension for dynamic variables.
Add more entries to markdown.json:
{
"Daily Checklist": { ... },
"Meeting Notes": {
"prefix": "meeting",
"body": [
"# 📝 Meeting Notes",
"## Date: ${CURRENT_DATE}",
"### Attendees:",
"- @person1",
"- @person2",
"### Action Items:",
"- [ ] Task 1"
]
}
}- Open
keybindings.json(Ctrl + Shift + P→Preferences: Open Keyboard Shortcuts (JSON)). - Add:
{
"key": "ctrl+alt+c",
"command": "editor.action.insertSnippet",
"args": { "name": "Daily Checklist" }
}Now, press Ctrl + Alt + C to insert your checklist instantly!
- Markdown All in One: Enhanced snippets + shortcuts.
- Text Power Tools: Dynamic variables (e.g.,
$CURRENT_TIME).
- Snippets save hours of repetitive typing.
- Works across Linux, Windows, and macOS (VS Code is cross-platform).
- Experiment with placeholders (e.g.,
${1:placeholderText}for tab stops).