Repository navigation
Markdown Editor: expose a command to toggle Editing / Locked mode #331423
Description
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.toggleLockcontrols the existing Markdown Preview and does not toggle the Markdown Editor's Editing / Locked mode.workbench.action.files.toggleActiveEditorReadonlyInSessioncontrols 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
- Markdown Editor should use a toggle to toggle between read-only and editable mode #326250 — Markdown Editor Editing / read-only mode UI toggle
- Agents window Markdown editor: Revealing Markdown markers shifts following content #327538 — Revealing Markdown markers can shift content while editing
- Test: Markdown editor feedback in the Agents window #326539 — Agent Feedback is offered in Locked mode
- Registers markdown editor commands as vscode commands, so that shortcuts can be customized #329414 — Markdown Editor commands can now be customized with shortcuts
Activity
vs-code-engineering commentedon Sep 10, 2026
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!
hediet commentedon Sep 10, 2026
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.
dmitrivMS commentedon Sep 24, 2026
Fixed by #329414
vijayupadya commentedon Sep 28, 2026
Verified on windows.