Skip to content

Automatically Activate Markdown Preview #2766

Open

Description

@dfinke

I would like to eliminate the step of pressing ctrl+k v to preview the md file I open. For the preview should always be on.

Thank you

Activity

  1. added
    feature-request
    markdown-ext
    on Feb 6, 2016
  2. RWeigelt commented on Feb 7, 2016

    @RWeigelt

    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.

  3. bpasero commented on Feb 7, 2016

    @bpasero
    Contributor

    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
  4. 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
  5. bpasero commented on Feb 29, 2016

    @bpasero
    Contributor

    Well we could still allow to swap the positions of source/preview.

  6. DonHouk commented on Oct 22, 2016

    @DonHouk

    I would also like to throw in support for an option to enable split screen previewing of Markdown files by default.

  7. 35 remaining items

  8. lramos15 commented on Jul 1, 2021

    @lramos15
    Member

    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

  9. wenfangdu commented on Jul 1, 2021

    @wenfangdu
    Contributor

    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?

  10. lramos15 commented on Jul 6, 2021

    @lramos15
    Member

    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.

  11. wenfangdu commented on Jul 6, 2021

    @wenfangdu
    Contributor

    Logan Ramos (@lramos15) Please reopen it 🙏.

  12. diminutivesloop commented on Jan 31, 2023

    @diminutivesloop
    Contributor

    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.

  13. Avivhdr commented on Mar 30, 2023

    @Avivhdr
  14. emanuel-v-r commented on Apr 17, 2024

    @emanuel-v-r

    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

  15. vladionescu commented on Feb 26, 2025

    @vladionescu

    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.

  16. MarinMlinarevic commented on Feb 26, 2025

    @MarinMlinarevic

    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

  17. AMDphreak commented on Jul 11, 2025

    @AMDphreak

    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.

  18. MarinMlinarevic commented on Apr 10, 2026

    @MarinMlinarevic

    Another issue dedicated to the diff view: #191565

  19. LiWeny16 commented on May 4, 2026

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

Metadata

Metadata

Labels

feature-requestmarkdown-ext

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions