Skip to content

Instantly share code, notes, and snippets.

@Shilo
Last active September 17, 2026 13:18
Show Gist options
  • Select an option

  • Save Shilo/8517464bca255b39c7afa7d323b23037 to your computer and use it in GitHub Desktop.

Select an option

Save Shilo/8517464bca255b39c7afa7d323b23037 to your computer and use it in GitHub Desktop.
Open Markdown files in preview mode by default in VS Code (and forks like Cursor, Antigravity)

Open Markdown Files in Preview by Default (VS Code & Forks)

By default, VS Code opens .md files in the text editor. To open them in preview mode instead:

Steps

  1. Open Settings (JSON): Ctrl+Shift+P → Preferences: Open User Settings (JSON)
  2. Add this to your settings.json:
"workbench.editorAssociations": {
    "*.md": "vscode.markdown.preview.editor"
}
  1. Save. All .md files now open as rendered preview.

Notes

  • Works in VS Code and forks (Cursor, Antigravity, etc.)
  • To edit a file, right-click → Open With... → select the text editor
  • Settings file locations:
    • VS Code: %APPDATA%/Code/User/settings.json
    • Cursor: %APPDATA%/Cursor/User/settings.json
    • Antigravity: %APPDATA%/Antigravity/User/settings.json
@llctrautmann

Copy link
Copy Markdown

Gold!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment