Problem:
When viewing Markdown files in Visual Studio Code it opens in the edit mode and you see markdown instead of the formatted version. To see the formatted version you have to right click on the tab and Open Preview mode. It’s often quicker to just read the file.
Solution:
Can’t believe I’ve gone so long without this. Open the Command Pallet (Crl+Shift+P / Cmd+Shift+P) and select Preferences: Open User Settings (JSON)
Add the following entry:
"workbench.editorAssociations": {
"*.md": "vscode.markdown.editor"
},
"markdown.preview.doubleClickToSwitchToEditor": true
When you need to edit the Markdown source, you can flip the toggle between the lock icon and the pencil icon.
Side note, if you’re in “Markdown Preview” (not Markdown Editor), you can switch from Preview to editing using these methods:
- Double-clicking anywhere on the rendered preview page
- Ctrl+Shift+V / Cmd+Shift+V
- At the top right, there’s a toolbar you can use to switch between editor and preview mode.