21
votes

In IntelliJ IDEA I often split the tabs vertically in order to be able to see multiple files at the same time. This can be useful when the two (or more) files have the same (or similar) structure and I want to compare them (e.g. language files).

My problem is that I'd like to scroll the two splits simultaneously, but can't figure out how (if possible). Is there any setting/plugin for this?

2

2 Answers

27
votes

To compare two files in IntelliJ IDEA 14, just select them in the Project view (keep Ctrl pressed for multi-selection) and choose Compare Two File from the context menu. This will open the Differences Viewer. You can also compare a file with the clipboard or the editor contents.

The Difference Viewer scrolls both files simultaneously (there is a button to disable sync'd scrolling) and allows editing both. Differences are highlighted by word, by line, or not at all.