Margin, an extension for VS Code

Edit Markdown as a page. Commit plain text.

Margin brings Notion-style editing to .md files in VS Code, Cursor, Windsurf and VSCodium: a clean page you edit in place, with a slash menu and blocks you drag around. When you save, only the lines you changed change.

code --install-extension zoomieloaf.margin

Open VSX is for Cursor, Windsurf, VSCodium and other editors without the VS Code Marketplace.

This is the real Margin editor. Switch to Edit or Markdown, tick a box, or open another file.

What it does

Everything you'd expect from a writing app, inside the editor you already use.

Edit in place
Press Ctrl+E or double-click any text. Select text for a menu with headings, lists, quotes, callouts and links.
Slash menu
Type / on an empty line for headings, lists, to-dos, tables, code blocks, callouts or a Mermaid diagram.
Block handles
Drag a block by its handle to move it, or duplicate and delete it from its menu.
Wiki-style links
A link to another .md file opens it in Margin, scrolled to the heading. Back and Forward work like in VS Code.
Tables
Tab moves between cells and adds a row at the end. Add or delete rows and columns from the block menu.
Export
PDF through the Edge or Chrome already on your computer, a single HTML file, or rich text for Slack and email.
AI actions
Improve, shorten, fix or translate a selection with GitHub Copilot in VS Code, or hand the prompt to a chat.

Your Markdown stays yours

Blocks you didn't touch are written back byte for byte: spacing, list markers, emphasis style, line endings. A block you edit is written in the style the file already uses.

git diff launch-plan.md
@@ -5,3 +5,3 @@ ## This week - [x] Record the demo-- [ ] Write the Open VSX description+- [x] Write the Open VSX description - [ ] Proofread the privacy policy

Getting started

  1. Install Margin from the VS Code Marketplace or Open VSX.
  2. Open any .md file and click Open in Margin in the editor title bar. When Margin asks, you can make it the default for Markdown.
  3. Press Ctrl+E (Cmd+E on macOS) to switch between reading and editing. Reopen in Text Editor brings the plain editor back.