To compare two pieces of text or code outside a project context using IntelliJ IDEA, follow these steps:
-
Create a scratch file:
-
Go to File | New | Scratch File or press Ctrl + Alt + Shift + Insert.
-
Alternatively, in the Project tool window, right-click any area and navigate to New | Scratch File.
-
-
Paste the text you want to compare into the scratch file.
-
Now you can copy the text you want to compare against.
-
Right-click in the scratch file and select Compare with Clipboard.