You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here are my 2 cents on the handling of Markdown files in Visual Studio Code.
I think that the main use case for opening a Markdown file is reading it. Not only for developers who consume the documentation of tools and libraries, but also for people like me whose job involves writing lots of documentation. I don't have definitive numbers, but I'm pretty sure I read (or at least scan) many more Markdown files than I edit on a given day. That's why I think that the current situation is a bit cumbersome:
When I open a Markdown file, it is displayed as plain text / source
If I want to read it with as little distraction as possible, I press ctrl+shift+v.
But when I see something I'd like to edit, pressing ctrl+k v doesn't work. I first have to switch back to the text editor (ctrl+shift+v), then enter the split view (ctrl+shift+v).
Regardless of whether I choose the better reading experience or (if I expect an edit) the better editing experience, I always have to press a hotkey immediately after opening a Markdown file.
For me personally (this may be a matter of personal preference), the perfect UX would look like this:
When I open a Markdown file, I automatically see the preview mode that you get today when pressing ctrl+shift+v.
Then, when I want to make an edit, I can switch to split view very fast, either by pressing an Edit button or using a simple hotkey. For Markdown preview (which doesn't have much interaction) it would be possible to use f2, which is the ultimate "change"/"edit"/"rename" hotkey across Windows, Office (most important key in Excel...) and Visual Studio.
Back to the feature request by Doug Finke (@dfinke), who wanted a setting to force Visual Studio code into split editor when opening a Markdown file:
I suggest a setting that controls how Markdown files are opened by default (e.g. markdown.defaultView), with the following values:
source for the (source) text editor
preview for the preview mode (i.e. the ctrl+shift+v mode)
split for the split editor (i.e. the ctrl+k v mode)
From the behavior of the UI it seems to me that the split editor is currently not a real standalone mode, but that ctrl+k v is merely a shortcut for manually splitting the editor and switching the second editor view to preview mode. This means that opening a Markdown file directly in split editor may require some rework (e.g. what should happen when opening several Markdown files).
To achieve a "quick win" within a limited budget, it would be possible to first implement the source and preview values of the markdown.defaultView setting and add a split setting later. That would not break the compatibility of existing configurations.
Of course I'd love to have a hotkey for switching directly from preview to split edtor, but having a markdown.defaultView setting alone would already be a huge improvement for my daily work.
Reacted by Damian Pereira, Neutrino, Mario Grgic, Vadim Yemtsov, Michael Wanyoike, webguy16, popod, Lucas Willems, Bern, pablo-vannini and 28 more
I think the best solution is to show both text and preview at the same time in one editor in the same way you can diff a file from git view to see original and modified. This has obvious advantages:
it is up to you if you want to see the text, preview or both at the same time depending on how you arrange the thing (setting would get persisted)
starting to edit is as simple as clicking some edit button to bring the text to the side of the preview without having to open an additional editor
you dont have to manage 2 editors for the same thing
Reacted by Stefan Junker, Shital Shah, Carl Von Stetten, Vadim Yemtsov, Yu Zhang, Cody Carse, astanet, Ufuktan Yildirim, Fabio Silva, Gal Grünfeld and 8 more
changed the title [-]Provide a setting to automatically preview markdown when opening an md file[/-][+]Improve source/preview viewing of markdown files[/+]on Feb 7, 2016
Logan Ramos (@lramos15) If I understand correctly, the gif only showed the config for auto-activating markdown.showPreview, but no config for auto-activating markdown.showPreviewToSide?
Logan Ramos (@lramos15) If I understand correctly, the gif only showed the config for auto-activating markdown.showPreview, but no config for auto-activating markdown.showPreviewToSide?
Wenfang Du (@wenfangdu) That is true, this issue has grown so much that I was trying to understand all the asks. I was going off Matt's comment here #2766 (comment) and the person after said 3 & 4. I can re-open the feature request as what you said is the thing that is missing.
I too had the problem that the preview as automatically opened, even with all extensions turned off. The issue in my case was that this configuration in settings.json:
Not sure when or how I added that, I reckon I must've accidentally selected to associate it somehow. Hope this helps someone!
This solution is very close to being perfect however it breaks the diff view. Instead of showing a rich preview diff or a source diff it just shows a split preview with no markings for the changes.
Reacted by Louis Laureys, Nikita Mikhaliuk, Marin Mlinarevic, Ilya Chumakov and Andrii Oriekhov
I too had the problem that the preview as automatically opened, even with all extensions turned off. The issue in my case was that this configuration in settings.json:
"workbench.editorAssociations": [
{
"viewType": "vscode.markdown.preview.editor",
"filenamePattern": "*.md"
}
],
Not sure when or how I added that, I reckon I must've accidentally selected to associate it somehow. Hope this helps someone!
This solution is very close to being perfect however it breaks the diff view. Instead of showing a rich preview diff or a source diff it just shows a split preview with no markings for the changes.
Unfortunately this is now more than an annoyance, it breaks Cline/Roo because they expect diff view to work.
VSCode team, can we have an updated response on official support for opening MD/RST files in preview mode automatically? This feature has been requested for >6 years with several duplicate issues opened in this repo.
I too had the problem that the preview as automatically opened, even with all extensions turned off. The issue in my case was that this configuration in settings.json:
"workbench.editorAssociations": [
{
"viewType": "vscode.markdown.preview.editor",
"filenamePattern": "*.md"
}
],
Not sure when or how I added that, I reckon I must've accidentally selected to associate it somehow. Hope this helps someone!
This solution is very close to being perfect however it breaks the diff view. Instead of showing a rich preview diff or a source diff it just shows a split preview with no markings for the changes.
Unfortunately this is now more than an annoyance, it breaks Cline/Roo because they expect diff view to work.
VSCode team, can we have an updated response on official support for opening MD/RST files in preview mode automatically? This feature has been requested for >6 years with several duplicate issues opened in this repo.
There is a related request that would fix the diff view problem, but it was closed recently due to not receiving enough upvotes: #206174
They need to rework the way previews are handled at the core. The fact that they open them up in a tab, and then that tab holds focus when clicked (click to scroll for example) and automatically opens new files in that view is pretty troll. The viewer should pop up as a non-tab viewer next to the markdown, not in split view as a tab. It should look and feel like an assistant to the editor, not like another editor window with nonexistent editing capabilities. Right now it feels disjointed from the markdown editing experience. It needs to feel more integrated.
Reacted by normalnormie, Tareq Ibrahim and Andrii Oriekhov
Activity
RWeigelt commentedon Feb 7, 2016
Here are my 2 cents on the handling of Markdown files in Visual Studio Code.
I think that the main use case for opening a Markdown file is reading it. Not only for developers who consume the documentation of tools and libraries, but also for people like me whose job involves writing lots of documentation. I don't have definitive numbers, but I'm pretty sure I read (or at least scan) many more Markdown files than I edit on a given day. That's why I think that the current situation is a bit cumbersome:
ctrl+shift+v.ctrl+k vdoesn't work. I first have to switch back to the text editor (ctrl+shift+v), then enter the split view (ctrl+shift+v).For me personally (this may be a matter of personal preference), the perfect UX would look like this:
ctrl+shift+v.Editbutton or using a simple hotkey. For Markdown preview (which doesn't have much interaction) it would be possible to usef2, which is the ultimate "change"/"edit"/"rename" hotkey across Windows, Office (most important key in Excel...) and Visual Studio.Back to the feature request by Doug Finke (@dfinke), who wanted a setting to force Visual Studio code into split editor when opening a Markdown file:
I suggest a setting that controls how Markdown files are opened by default (e.g.
markdown.defaultView), with the following values:sourcefor the (source) text editorpreviewfor the preview mode (i.e. thectrl+shift+vmode)splitfor the split editor (i.e. thectrl+k vmode)From the behavior of the UI it seems to me that the split editor is currently not a real standalone mode, but that
ctrl+k vis merely a shortcut for manually splitting the editor and switching the second editor view to preview mode. This means that opening a Markdown file directly in split editor may require some rework (e.g. what should happen when opening several Markdown files).To achieve a "quick win" within a limited budget, it would be possible to first implement the
sourceandpreviewvalues of themarkdown.defaultViewsetting and add asplitsetting later. That would not break the compatibility of existing configurations.Of course I'd love to have a hotkey for switching directly from preview to split edtor, but having a
markdown.defaultViewsetting alone would already be a huge improvement for my daily work.bpasero commentedon Feb 7, 2016
I think the best solution is to show both text and preview at the same time in one editor in the same way you can diff a file from git view to see original and modified. This has obvious advantages:
[-]Provide a setting to automatically preview markdown when opening an md file[/-][+]Improve source/preview viewing of markdown files[/+]bpasero commentedon Feb 29, 2016
Well we could still allow to swap the positions of source/preview.
DonHouk commentedon Oct 22, 2016
I would also like to throw in support for an option to enable split screen previewing of Markdown files by default.
35 remaining items
lramos15 commentedon Jul 1, 2021
Here's a gif that demonstrates how to do exactly what is suggested above. Excuse the link as it was too large for github
https://s6.gifyu.com/images/recordinga1cc2edb37532e9b.gif
wenfangdu commentedon Jul 1, 2021
Logan Ramos (@lramos15) If I understand correctly, the gif only showed the config for auto-activating
markdown.showPreview, but no config for auto-activatingmarkdown.showPreviewToSide?lramos15 commentedon Jul 6, 2021
Wenfang Du (@wenfangdu) That is true, this issue has grown so much that I was trying to understand all the asks. I was going off Matt's comment here #2766 (comment) and the person after said 3 & 4. I can re-open the feature request as what you said is the thing that is missing.
wenfangdu commentedon Jul 6, 2021
Logan Ramos (@lramos15) Please reopen it 🙏.
diminutivesloop commentedon Jan 31, 2023
This solution is very close to being perfect however it breaks the diff view. Instead of showing a rich preview diff or a source diff it just shows a split preview with no markings for the changes.
Avivhdr commentedon Mar 30, 2023
starball5 commentedon Aug 23, 2023
Related on Stack Overflow: How can I automatically open Tex/PDF/Markdown previews side-by-side with the markup when opening the source file in VS Code?
emanuel-v-r commentedon Apr 17, 2024
Any news on this? Automatic side by side preview would be nice to have. There's this extension with a lot of downloads only for that https://marketplace.visualstudio.com/items?itemName=hnw.vscode-auto-open-markdown-preview
vladionescu commentedon Feb 26, 2025
Unfortunately this is now more than an annoyance, it breaks Cline/Roo because they expect diff view to work.
VSCode team, can we have an updated response on official support for opening MD/RST files in preview mode automatically? This feature has been requested for >6 years with several duplicate issues opened in this repo.
MarinMlinarevic commentedon Feb 26, 2025
There is a related request that would fix the diff view problem, but it was closed recently due to not receiving enough upvotes: #206174
AMDphreak commentedon Jul 11, 2025
They need to rework the way previews are handled at the core. The fact that they open them up in a tab, and then that tab holds focus when clicked (click to scroll for example) and automatically opens new files in that view is pretty troll. The viewer should pop up as a non-tab viewer next to the markdown, not in split view as a tab. It should look and feel like an assistant to the editor, not like another editor window with nonexistent editing capabilities. Right now it feels disjointed from the markdown editing experience. It needs to feel more integrated.
MarinMlinarevic commentedon Apr 10, 2026
Another issue dedicated to the diff view: #191565
LiWeny16 commentedon May 4, 2026