I\'m really liking the IntelliJ diff tool. I\'m wondering if it is possible to use this tool to diff two arbitrary files. I.e. files NOT in an IntelliJ project. Just pick tw
From the terminal, you can use the idea launcher directly like so:
# Windows
idea.exe diff path1 path2
# MacOS/Linux
idea diff path1 path2
At least for MacOS (I'm not certain of Windows), if you've created the Command-line Launcher via "Tools -> Create Command-line Launcher..." it's as simple as the following:
# Create some files to diff
echo "This is line 1" > file1.txt
echo "This is line 2" > file2.txt
# Diff with IntelliJ
idea diff file1.txt file2.txt
Note this works with other JetBrains applications as well; for example, using WebStorm or PyCharm:
# Diff with WebStorm
webstorm diff file1.txt file2.txt
# Diff with PyCharm
charm diff file1.txt file2.txt
Reference