Skip to content

Markdown Editor: expose a command to toggle Editing / Locked mode #331423

Closed

Description

@RuumaLilja

Feature request

Please expose the existing Editing / Locked mode toggle in the Markdown Editor (vscode.markdown.editor) as a VS Code command that can be assigned in Keyboard Shortcuts / keybindings.json.

A default keybinding is not required. A command for toggling the mode of the active Markdown Editor would be enough.

Motivation

I frequently switch between reading and editing rendered Markdown.

In Editing mode, clicking a rendered block reveals its Markdown syntax and can change the document layout. When I am mainly reading or reviewing a document, I prefer Locked mode because the rendered view stays stable.

However, switching between Editing and Locked currently requires using the mode toggle in the UI.

The toggle itself can be reached through keyboard focus navigation, but there is no dedicated VS Code command that I can bind directly to a shortcut.

This is also useful in the Agents window, where range-based Agent Feedback is available in Locked mode, so my workflow often becomes:

Editing
  ↓
Locked
  ↓
Editing

Being able to switch directly from the keyboard would make this workflow much smoother.

Current behavior

  • The Markdown Editor has a UI toggle for Editing / Locked.
  • I could not find a dedicated VS Code command for this mode toggle.
  • markdown.preview.toggleLock controls the existing Markdown Preview and does not toggle the Markdown Editor's Editing / Locked mode.
  • workbench.action.files.toggleActiveEditorReadonlyInSession controls the file-level read-only state and is separate from the Markdown Editor's Editing / Locked mode.
  • Registers markdown editor commands as vscode commands, so that shortcuts can be customized #329414 registers Markdown Editor commands as VS Code commands so that their shortcuts can be customized, but the Editing / Locked toggle is not currently exposed as one of these commands.

Expected behavior

Expose a command that toggles the active Markdown Editor between Editing and Locked mode.

For example (command name only illustrative):

markdown.editor.toggleLocked

Users could then assign any keybinding they prefer.

Related

Activity

  1. vs-code-engineering commented on Sep 10, 2026

    @vs-code-engineering
    Contributor

    This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

    Happy Coding!

  2. hediet commented on Sep 10, 2026

    @hediet
    Member

    Additional feedback: please also consider a default keyboard shortcut for this command, following Obsidian's Cmd+E convention, and show the resolved shortcut when hovering the Editing/Locked toggle.

    Cmd+E is currently used by Find with Selection on macOS, so the default and scoping need evaluation. If used, it should only apply while the Markdown custom editor is focused. Regardless of the chosen default, the toggle hover should display the effective configured keybinding so the command is discoverable.

  3. dmitrivMS commented on Sep 24, 2026

    @dmitrivMS
    Collaborator

    Fixed by #329414

  4. vijayupadya commented on Sep 28, 2026

    @vijayupadya
    Contributor

    Verified on windows.

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions