How to Compare Highlighted Text With Copied Text in Visual Studio Code

The aim of this page📝 is to show a feature that is often used, but slightly hidden in vscode — the diff between only a selection within a larger file with the copied text.

Pavol Kutaj
1 min readFeb 21, 2023

As I am doing most of my operation work (todo list via git, thinking via markdown, coding in python/bash) in VSCode, I am using this feature quite often

OOTB request dismissed

Executed with PartialDiff in a little uncomfortable fashion

  • Highlight the text within VSCode
  • Run PartialDiff: Select Text for Compare
  • Here is the uncomfortable bit: Don’t remove the highlight within VSCode — even as you change applications!
  • Copy whatever you need to compare elsewhere
  • Run _PartialDiff: Compare Text with Clipboard
again, keep the text highlighted on the left side




Pavol Kutaj

Today I Learnt | Infrastructure Support Engineer at with a passion for cloud infrastructure/terraform/python/docs. More at