Turn the currently open Markdown or HTML file into a live local preview link you can open in a browser or copy and share, refreshing instantly as you edit.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Turn the currently open Markdown or HTML file into a live local preview link: open it in a browser, or copy the link and share it with a colleague or another device. The browser content refreshes automatically as you edit — no need to manually refresh, and no need to save the file first.
Features
Markdown & HTML — generate a link from the Command Palette, right-click menu, or title bar icon, then open in browser or copy the link
Stable links — the same file always gets the same address; multiple files can preview at once
Live sync — edits refresh automatically (no save needed); Markdown updates in place, HTML reloads
Table of contents — nested navigation, scroll tracking, resizable, collapsible; shows the file's relative path; plus a Related documents list, and relative links to other docs open as previews
Highlights & footnotes — ==highlight== text with notes shown as margin cards, and footnotes rendered in a collapsible block
Assets just work — sibling files (images/, embeds/, …) and relative references are served automatically
Reading comfort — code highlighting with a wrap toggle, font size and scrollbar width controls, and auto/dark/light themes
LAN sharing — get a localhost and a LAN IP link so others on your WiFi can open the preview
Usage
Open a .md or .html file
Open the Command Palette with Cmd+Shift+P and run OnAir: Generate Live Preview Link (or click the globe icon in the top-right of the editor)
Choose Open in Browser or Copy Link (the menu also offers (LAN) variants when a local network is detected)
Keep editing — the browser content updates automatically
How it works / Notes
A local HTTP + WebSocket server starts on the first free port from 5757; links look like http://127.0.0.1:<port>/preview/<id>.
The (LAN) options swap 127.0.0.1 for your machine's LAN IP so others on the same network can open the preview. These links aren't public.
The server runs while VS Code is open and stops when it closes, so links expire then.
Assets are served only from within the previewed file's project (its workspace folder, or its own directory otherwise), so ../ paths inside the project resolve while nothing outside is exposed.
Markdown link paths with spaces or non-ASCII characters must be percent-encoded (images/%E5%9B%BE.png) or wrapped in angle brackets (), or Markdown won't parse them.