Split the current document into two panes with Split Editor in Group (one tab, primary/secondary), with continuous newspaper-style columns and synchronized scrolling (document-line based visibleRanges + revealRange).
Features
Multicol Reading: Toggle Two-Column Reading(multicol.toggleTwoColumn): switch between single pane and two panes (editor title bar button, status bar, Ctrl+Alt+N / Cmd+Alt+N).Turn On Two-Column Reading/Restore Single Column: explicit commands in the Command Palette.multicol.overlapLines: optional vertical overlap between columns (0–10 document lines).- Page Down / Page Up when multicol is active: step by one column height.
- Per-file editor state (persisted in the workspace): each document URI can independently be “two-column on” or off; missing entry means single column. Reload restores split per URI that was left on, including scroll anchor (best-effort).
About the author
雷鹏(Lei Peng) — The founder of Terark Inc, the creator of TerarkDB, and the new ToplingDB.
Debug
- Run
npm installin the repo root. - Open this folder in VS Code.
- Press F5 (Run Extension) to launch an Extension Development Host.
- Open a text file and run Multicol Reading: Toggle Two-Column Reading.
Package: npm install -g @vscode/vsce then vsce package, install the VSIX from VS Code.
Layout
| Path | Role |
|---|---|
package.json |
Manifest: commands, keybindings, configuration |
src/extension.ts |
Activation: commands, status bar, per-document persistence (multicol.documents.v1 map) |
src/session.ts |
MulticolSession: scroll sync via revealRange(AtTop) |
src/layout.ts |
workbench.action.splitEditorInGroup / joinEditorInGroup |
src/editorMetrics.ts |
Lines-per-column heuristic from visibleRanges |
Limits (VS Code API)
- No public pixel scroll API on
TextEditor; scrolling usesrevealRange— not pixel-identical to native wheel/trackpad in all themes. - Layout uses Split Editor in Group only (two panes per tab); there is no supported third column in the same group.
- Restore single column runs
joinEditorInGroup(notjoinTwoGroups). - If split fails mid-flight, the extension best-effort rolls back with
joinEditorInGroupuntil visible editor count for that document is back to what it was before the attempt. - Some editor types cannot split in group (non-text editors); split may fail with a clear error.
Publish (maintainer)
-
GitHub Release + VSIX
Push a version tagv*(e.g.v0.1.1). The Release workflow compiles, runsvsce package, and attaches the.vsixto a GitHub Release. -
Visual Studio Marketplace
- Create a publisher (ID must match
package.json→publisher, hererockeet). - Create a Personal Access Token: Azure DevOps → User settings → Personal access tokens → Custom defined → scope Marketplace (Manage).
- CI (recommended): In the GitHub repo → Settings → Secrets and variables → Actions, add secret
VSCE_PAT. Pushing a tagv*runs release.yml: it uploads the VSIX to the GitHub Release and publishes that same VSIX to the Marketplace whenVSCE_PATis set. - Local: In PowerShell:
$env:VSCE_PAT = 'your_token_here'→npm run package→npx vsce publish(ornpx vsce publish -p $env:VSCE_PAT).
- Create a publisher (ID must match
License
MIT — see LICENSE.