VSCODE: Quik diff checker at your local


Quick Diff checker with VS Code
We all need to compare and contrast files: two configurations, different code versions, and environmental differences. Most people download diff tools or use online comparison sites.
Why go through all that when VS Code is right there?
The Trick
Here's a simple hack. Create a folder diff-checker
or any folder with two files, a
and b
. Now you can compare anything.
Select both files a
and b
, right-click, and choose "compare selected". Boom! A new tab opens showing a ↔ b
with every difference highlighted in colors: red for deletions, green for additions, yellow for changes.
Use this to compare any content in the future — configs, code, documentation, whatever—just by updating files a
and b
.
When This Saves Your Day
- Comparing production config with staging before deployment—you'll instantly spot differences.
- Checking what changed during refactoring. Select the original file for comparison, make changes, and then compare the modified file with the selected file.
- Spotting differences between two Kubernetes deployment YAMLs before applying changes.
Why This Beats Alternatives
- External diff tools need installation and break your workflow.
- Online diff checkers mean copying sensitive code to websites.
- Git diff in terminal is hard to read for complex changes.
- VS Code's built-in diff is already there. Zero setup, stays in your workspace, fast and clean.
Bottom Line
Add an alias to open this folder in VS Code on demand from your terminal:
alias diffcheck = 'code ~/workspace/projects/diff-checker'
This helps in file comparison without leaving your editor. No extra tools, just simple and effective.
Happy Diffing! 🔍
Subscribe to my newsletter
Read articles from codenio directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
