Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Smart Markdown PasteNew to Visual Studio Code? Get it now.
Smart Markdown Paste

Smart Markdown Paste

Anthony Greco

|
1 install
| (0) | Free
Paste Markdown into the current section and automatically rebase ATX heading levels
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Smart Markdown Paste

Paste Markdown into the current section and automatically rebase ATX headings to fit the surrounding document hierarchy.

Install from the Visual Studio Marketplace.

How to use

  1. Copy a Markdown fragment.
  2. Place your cursor inside the section where it belongs.
  3. Press Ctrl+Alt+V on Windows/Linux or Cmd+Alt+V on macOS.
  4. The pasted headings are shifted together so the shallowest heading becomes a direct child of the current section.

You can also run Markdown: Paste with Rebased Headings from the Command Palette.

Example

Current document:

# Document

## Existing section

<!-- cursor -->

Clipboard:

# Foo

## Bar

### Baz

Result:

# Document

## Existing section

### Foo

#### Bar

##### Baz

The relative hierarchy is preserved; only the heading depth changes.

Behavior

  • No parent heading: paste unchanged.
  • No ATX headings in the clipboard: paste unchanged.
  • Headings inside fenced code blocks and YAML front matter are ignored.
  • Pasting while the cursor is inside a fenced code block or YAML front matter is literal.
  • If rebasing would require an H7 or deeper heading, the paste is cancelled instead of flattening or corrupting the hierarchy.
  • With multiple cursors, the clipboard is pasted literally because each cursor can have a different heading context.

Setext headings (Heading followed by === or ---) are intentionally left unchanged.

Shortcut

The extension contributes Ctrl+Alt+V on Windows/Linux and Cmd+Alt+V on macOS itself; no keybindings.json setup is required.

VS Code currently uses the same shortcut for editor dictation. This extension intentionally takes precedence while focus is in a writable Markdown editor. Dictation remains available elsewhere, and user keybindings can always override the extension binding.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft