One-click Edit ↔ Preview toggle for MarkEdit. A thin helper on top of MarkEdit-preview.
한국어 · Releases · MIT License
MarkEdit-preview already provides everything you need to render Markdown previews inside MarkEdit. The only friction is the default UX:
- The
View Modetoolbar item opens a dropdown menu every time — even when you just want to flip between Edit and Preview. ⇧⌘V(Change Mode) cycles through three modes by default (edit → side-by-side → preview), not a clean two-way toggle.
Direct Preview is a one-shot installer that standardizes the workflow into a single click:
- A
Toggle Previeweye icon you can drag into the MarkEdit toolbar. ⇧⌘Vreduced to a two-state toggle: Edit ⇄ Preview.
That's it. We do not replace MarkEdit-preview — the actual rendering and mode switching are still done by it.
- macOS with MarkEdit 1.24.0+
- MarkEdit-preview installed first
Download markedit-direct-preview.js from the latest Release and copy it to:
~/Library/Containers/app.cyan.markedit/Data/Documents/scripts/
Or build from source — see Develop below.
- Restart MarkEdit (
⌘Q, relaunch). - From the menu bar, choose Extensions → Direct Preview → Apply One-Click Toggle Setup…
- Restart MarkEdit again.
- Right-click the toolbar → Customize Toolbar… → drag the
Toggle Previeweye icon into your toolbar → Done.
That's the full setup. The eye icon now toggles Edit ⇄ Preview in a single click, no menu.
For full transparency, it writes the following keys into MarkEdit's settings.json:
It merges with any keys you already have. If you prefer to do it by hand, copy the JSON above into your settings.json and skip the extension entirely — the result is identical.
To roll it back, choose Extensions → Direct Preview → Revert One-Click Toggle Setup…
These are upstream constraints in MarkEdit and markedit-api, not bugs in this extension:
- Toolbar icon cannot change with mode. MarkEdit's
customToolbarItems[*].iconis static. The eye icon stayseye; it does not flip toeye.slashbased on the current mode. - Split-button (icon = action, ⌄ = menu) is not supported. Each toolbar item is either a menu or an action, not both.
- No external API to trigger mode switching. This extension cannot programmatically toggle the preview — it only configures MarkEdit so that the existing
Change Modeaction gets bound to a one-click toolbar item.
If you want any of these, the right place is a feature request on MarkEdit or MarkEdit-preview.
git clone https://github.com/Squarelight-ai/markedit-direct-preview.git
cd markedit-direct-preview
npm install
npm run build
npm run install:script # copies dist/ into MarkEdit's scripts folder
npm run reload # restarts MarkEditThe build produces a single CJS file at dist/markedit-direct-preview.js, around 5 KB.
This project would not exist without the upstream work by MarkEdit.app:
- MarkEdit — the editor
- MarkEdit-preview — the preview engine and
Change Modecommand - MarkEdit-api — the extension API
All third-party trademarks are property of their respective owners.
MIT © 2026 Squarelight Inc.

{ "editor.customToolbarItems": [ { "title": "Toggle Preview", "icon": "eye", "actionName": "Change Mode" } ], "extension.markeditPreview": { "changeMode": { "modes": ["edit", "preview"] } } }