Introducing Markdown Toggle Preview: Streamline Your Markdown Workflow in VS CodeIf you work with Markdown files in Visual Studio Code, you've probably found yourself switching between the source code and preview views countless times. Opening the preview, closing it, reopening it—it's a small friction point that adds up over the course of a day. That's why I built Markdown Toggle Preview, a lightweight VS Code extension that makes toggling between source and preview as simple as clicking a button. The ProblemVS Code has excellent built-in Markdown preview support, but switching between source and preview requires either:
While these methods work, they don't provide a clear, persistent visual indicator of which mode you're in, and the preview state doesn't persist across sessions. For documentation writers, technical bloggers, and anyone working extensively with Markdown, this can become tedious. The SolutionMarkdown Toggle Preview adds a simple, intuitive toggle button directly in your editor toolbar whenever you're working with a Markdown file. One click switches between source and preview mode—that's it. Key Features🎯 One-Click Toggle 👁️ Visual Feedback 💾 Persistent State 🧹 Smart Cleanup ⚙️ Configurable Defaults How It WorksThe extension leverages VS Code's native Markdown preview API—meaning you get all the features you already love (GitHub-flavored Markdown, syntax highlighting in code blocks, math rendering, etc.) without any custom rendering logic or additional dependencies. When you toggle to preview mode, the extension uses VS Code's built-in Getting StartedInstallation
Usage
Optional: Add a Keyboard ShortcutKeyboard junkie? Add a custom keybinding:
Configuration
Why I Built ThisAs a developer who reads a lot of documentation and technical content, a lot of times I just wanted to view a markdown file. It irked me that there was no button to preview, the default behaviour of the existing preview button was split screen view which I don't like if I just want to read the markdown file. You had to rememeber hold What's Next?I currently don't have any further plans. If you have feature requests or find any issues, please open an issue on the GitHub repository. Try It OutIf you work with Markdown files in VS Code, give Markdown Toggle Preview a try. It's a small improvement that makes a real difference in daily workflow. Download it from the VS Code Marketplace or check out the source code on GitHub. Happy writing! Links: |