Visual Studio Code - is there a Compare feature like that plugin for Notepad ++?
right click on first file and select
then right click on second file and select
Screencast:
You can compare files from the explorer either from the working files section or the folder section. You can also trigger the global compare action from the command palette.
- Open a folder with the files you need to compare,
- Select two using SHIFT
- Right click "Compare Selected"
I have Visual Studio Code version 1.27.2 and can do this:
Compare two files
- Drag and drop the two files into Visual Studio Code
- Select both files and select Select for Compare from the context menu
- Then you see the diff
- With Alt+F5 you can jump to the next diff
Compare two in-memory documents or tabs
Sometimes, you don't have two files but want to copy text from somewhere and do a quick diff without having to save the contents to files first. Then you can do this:
- Open two tabs by hitting Ctrl+N twice:
- Paste your first text sample from the clipboard to the first tab and the second text sample from the clipboard to the second tab
- Select the first document Untitled-1 with Select for Compare:
- Select the second document Untitled-2 with Compare with Selected:
- Then you see the diff:
Here is my favorite way, which I think is a little less tedious than the "Select for Compare, then Compare With..." steps.
- Open the left side file (not editable)
-
F1
Compare Active File With... - Select the right side file (editable) - You can either select a recent file from the dropdown list, or click any file in the Explorer panel.
This works with any arbitrary files, even ones that are not in the project dir. You can even just create 2 new Untitled files and copy/paste text in there too.
Another option is using command line:
code -d left.txt right.txt
Note: You may need to add code
to your path first. See: How to call VS Code Editor from command line