Skip to content
| Marketplace
Sign in
Visual Studio>Tools>External Clipboard Merge for Visual Studio
External Clipboard Merge for Visual Studio

External Clipboard Merge for Visual Studio

MjosDrone

|
4 installs
| (1) | Free
Opens an external merge tool to compare the active editor content with the clipboard content. This makes it easy to review and integrate new changes made by AI Code Assistants. Configure your merge to
Download
Extension icon

External Merge for Visual Studio

Visual Studio Marketplace Version License: MIT

A Visual Studio extension to launch your favorite external diff/merge tool to compare the active editor's content with your clipboard. Ideal for reviewing and integrating code snippets generated by AI assistants like Gemini, ChatGPT or Claude.

This project is a C#/.NET port of my original TypeScript extension for VS Code.

How It Works

When using an AI code assistant, you often get a large block of code. The standard workflow of copy-pasting overwrites your work and makes it difficult to see what changed.

This extension streamlines the process by letting you use a powerful, dedicated diff tool to see a side-by-side comparison, making it trivial to review, merge, and accept changes with confidence.

Extension Demo Preview

Features

  • ✅ Launch Any Diff Tool: Configure the extension to use your favorite tool (Beyond Compare, KDiff3, WinMerge, Meld, etc.).
  • 🚀 Side-by-Side View: Compares the content of your currently active editor tab with the text in your clipboard.
  • 💾 Seamless Integration: After you merge and save in the external tool, the changes are instantly applied back to your editor in Visual Studio.
  • ⌨️ Configurable Hotkey: Trigger the merge with a convenient keyboard shortcut (defaults to Ctrl+Alt+M).
  • ⚡ Safe and Non-Blocking: The extension runs the external process asynchronously so Visual Studio remains responsive.

Installation

  1. Download the extension from the Visual Studio Marketplace.
  2. Double-click the downloaded .vsix file to install.
  3. Restart Visual Studio.

Configuration

All settings can be configured in Visual Studio via Tools > Options > External Merge.

Options Screenshot

1. Tool Path

The full, absolute path to your merge tool's executable.

  • Example: C:\Program Files\Beyond Compare 4\BCompare.exe

2. Tool Arguments

The command-line arguments to pass to the tool. The extension substitutes the following placeholders:

  • {filePath1}: Path to a temporary file containing the active editor's content.
  • {filePath2}: Path to a temporary file containing the clipboard content.
  • {outputFilePath}: Path to the temporary file where the merged result should be saved.

Configuration Examples for Popular Tools

Beyond Compare:

"{filePath1}" "{filePath2}" /savetarget="{outputFilePath}"

KDiff3:

"{filePath1}" "{filePath2}" -o "{outputFilePath}"

WinMerge: (WinMerge modifies the second file in-place if no output is specified, but using the output argument is cleaner)

/e /u "{filePath1}" "{filePath2}" "{outputFilePath}"

(/e closes WinMerge on a single Esc key press, /u prevents adding paths to MRU list)

Meld: (Meld typically modifies one of the input files. We can configure it to modify the "editor" temp file.)

"{filePath1}" "{filePath2}"

Rider merge:

diff "{filePath1}" "{filePath2}"
  • Important: If your tool modifies an input file in-place (like Meld), make sure the {outputFilePath} placeholder is NOT present in your Tool Arguments string. The extension will then correctly read the result from the {filePath1} temp file.

Usage

  1. Open a file in the Visual Studio editor.
  2. Copy the new code you want to merge into your clipboard.
  3. In Visual Studio, press Ctrl+Alt+M (or trigger the command Tools > Merge with Clipboard).
  4. Your external merge tool will launch with the two versions.
  5. Make your merges in the tool.
  6. Save the result and close the tool.
  7. The changes will be reflected in your Visual Studio editor.

Building from Source

If you want to build the extension yourself:

  1. Clone this repository.
  2. Make sure you have the Visual Studio extension development workload installed via the Visual Studio Installer.
  3. Open the .sln file in Visual Studio.
  4. Build the solution. The .vsix installer will be in the bin\Debug or bin\Release folder.

Contributing

Contributions are welcome! Please feel free to open an issue to report a bug or suggest a feature, or create a pull request with your improvements.

License

This project is licensed under the MIT License.

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