Vim Keys for Markdown Preview adds Vim-style keyboard navigation to VS Code's built-in Markdown preview. It lets you scroll, search the rendered page, and follow links without taking focus away from the preview.
Features
Navigate with Vim-style motions and counts.
Scroll smoothly at a constant linear rate while holding a scroll key.
Search rendered text and cycle through matches.
Show hints for visible links in the preview document, including links injected by other preview extensions.
Use links through their original click behavior, including same-page fragment navigation.
Leave editable fields, modifier-key combinations, and IME composition input unaffected.
Keyboard shortcuts
h / j / k / l or arrow keys: scroll left, down, up, or right.
d / u: scroll down or up by half a page.
gg / G: scroll to the top or bottom.
1 to 99 followed by a scroll key: repeat the motion. For example, 3j scrolls down three times.
i: enter insert mode. Press Esc to return to navigation.
\: toggle navigation off or on.
?: show keyboard help. Press Esc to close it.
/: search preview text. Matches appear while you type. Press Enter to confirm or Esc to cancel. Use n or N to move to the next or previous match.
f: show hints for visible links. Type a hint code to activate the original link, or press Esc to cancel.
Migrate from Vimium Markdown Preview
Uninstall FallenMax.vimium-markdown-preview before installing this extension. VS Code does not automatically migrate installed extensions when an extension ID changes.
Vimium attribution
The key-sequence design takes inspiration from Vimium's KeyHandlerMode. This extension implements its behavior independently for the Markdown preview and does not include Vimium source code or its Chrome extension runtime. Thanks to Phil Crosby and all Vimium contributors. Vimium is distributed under the MIT License.
Development checks
pnpm test: build the extension and run unit tests for state transitions.
pnpm test:e2e: verify interactions in a controlled local HTML page.
pnpm test:preview: verify script injection and trusted keyboard input in an isolated VS Code Extension Development Host.
pnpm test:vsix: package the extension, install the VSIX in isolated storage, and verify preview wiring.