/vsdiff

Apply clipboard as patch.

Primary LanguageJavaScriptApache License 2.0Apache-2.0

VSCode Diff Apply Extension

This Visual Studio Code extension allows you to apply a diff from your clipboard to the currently open file. It is particularly useful when you need to apply a specific set of changes from code reviews, emails, or other sources directly to your files within the editor.

Features

  • Apply diffs from your clipboard to the currently open file with a simple command or keybinding.
  • Error messages are shown when the diff cannot be applied or if there are conflicts.

Installation

  1. Download or clone this repository to your local machine.
  2. Open the project folder in Visual Studio Code.
  3. Press F5 to run the extension in a new Extension Development Host window.

Usage

  1. Copy the diff text to your clipboard. Make sure it is in Unified Diff format.
  2. Open the file you want to apply the diff to in Visual Studio Code.
  3. Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac) to open the Command Palette.
  4. Type "Apply Diff" in the Command Palette and press Enter, or use the keybinding Ctrl+Alt+D (Windows/Linux) or Cmd+Alt+D (Mac) to run the "Apply Diff from Clipboard" command.
  5. The extension will attempt to apply the diff to the currently open file. If the diff is applied successfully, a success message will be shown. If there are any issues or conflicts, an error message will be displayed.

Notes

Coding, Debugging, Refactoring, Testing, Running, Question