Skip to content

Instantly share code, notes, and snippets.

@Shilo
Last active August 8, 2026 14:10
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+PPreferences: 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
@rudolf-the-brief

Copy link
Copy Markdown

Thank you. This is very useful.

@Marcus0035

Copy link
Copy Markdown

Thanks!

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