Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Paste Indentation FixNew to Visual Studio Code? Get it now.
Paste Indentation Fix

Paste Indentation Fix

Saverio Miroddi

| (0) | Free
Keeps the existing line following pasted code at its original indentation in any language.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Paste Indentation Fix

Keeps the existing line after pasted code at its original indentation, in any language. VS Code still indents the pasted code normally.

Use Cmd+V on macOS, Ctrl+V on Windows/Linux, or Paste without Moving the Following Line from the Command Palette.

The workaround preserves an existing following line when the paste leaves that line intact. This includes whole-line copies made with nothing selected and selections ending at the start of a line. It addresses VS Code's auto-indent-on-paste behavior when these settings are enabled:

{
  "editor.autoIndent": "full",
  "editor.autoIndentOnPaste": true
}

The underlying VS Code bug is language-independent and has been reported in Ruby and PHP. For example, paste two items before a Ruby array's closing bracket. VS Code can move the existing bracket:

array = [
  "foo",
  "bar",
  "baz",
  ]

Paste Indentation Fix preserves its original indentation:

array = [
  "foo",
  "bar",
  "baz",
]

The correction adds one undo step. Native menu Paste bypasses the workaround. Line remainders changed by the paste and multiple cursors retain VS Code's normal behavior.

Requires VS Code 1.141.0 or newer. Tested on macOS with the reported Ruby and PHP examples, whole-line copies and replacements, partial selections, mid-line paste, overtype, tabs, CRLF, multiple cursors, cursor placement, and repeated undo/redo.

Related VS Code reports: #143573 (Ruby) and #221574 (PHP). Proposed upstream fix: PR #329281.

Previously named Ruby Paste Fix. Version 0.2.0 removes the Ruby-only restriction; the Marketplace identifier remains 64kramsystem.ruby-paste-fix so existing installations receive updates.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft