TextMate's built-in comparison shows you exactly what changed between two files
TextMate has a file comparison feature built into the application — you do not need to install anything extra or switch to a different program. Open both files you want to compare, then use the Comparison menu to view them side by side with differences highlighted in color. The comparison shows additions in green, deletions in red, and modifications in yellow, making it easy to spot what changed.
This works best when you are comparing two versions of the same file — like an original and an edited copy, or a file before and after you made changes. The comparison view stays open as long as you need it, and you can close it and return to normal editing whenever you are done.
Key Takeaways
- Open both files in TextMate, then go to Bundles menu and select Comparison to activate the side-by-side view.
- Added lines appear highlighted in green, deleted lines in red, and changed lines in yellow so differences are immediately visible.
- The comparison view does not modify your files — it only shows you what is different between them.
- You can close the comparison view at any time by selecting Bundles > Comparison again to toggle it off.
Opening the comparison view
Start by opening both files you want to compare in TextMate. You can open them as separate tabs or in separate windows — the comparison feature works either way. Make sure both files are visible or at least accessible from your open tabs.
Once both files are open, click on the Bundles menu at the top of the screen. Scroll down until you see the Comparison option. Click it, and TextMate will split your view to show both files side by side. If you do not see a Bundles menu, check that you are using TextMate 2 or later — earlier versions may have this feature in a different location.
Understanding the color coding
When the comparison view opens, TextMate uses colors to mark every difference between the two files. Green highlighting shows lines that exist in the second file but not in the first — these are additions. Red highlighting shows lines that exist in the first file but not in the second — these are deletions. Yellow highlighting shows lines that are present in both files but contain different text — these are modifications.
The colors make it fast to scan through a long file and find what changed. If you have a file with hundreds of lines and only a few differences, the color coding lets you jump straight to the parts that matter instead of reading through everything line by line.
Navigating between differences
When you have the comparison view open, you can move between differences using keyboard shortcuts. Press Control-Up Arrow to jump to the previous difference, or Control-Down Arrow to jump to the next difference. This lets you move quickly through a file without scrolling manually, especially useful when comparing large files with only a few changes scattered throughout.
If you want to close the comparison view and return to normal editing, go back to the Bundles menu and click Comparison again. This toggles the feature off and returns you to the standard single-file view. Your files remain open and unchanged — the comparison view only shows you the differences, it does not modify anything.
When comparison works best
The TextMate comparison feature works well for text-based files like code, configuration files, scripts, and plain text documents. It is less useful for binary files like images or compiled programs, which TextMate cannot display in a readable way.
Comparison is most helpful when you are checking what you changed in a file you have been editing, reviewing edits someone else made to a document, or comparing two versions of a configuration file to see what settings differ. If you need to compare files that are very large or in a format TextMate does not recognize, you may need to use a dedicated comparison tool instead.
Troubleshooting comparison issues
If the Comparison option does not appear in your Bundles menu, make sure you have TextMate 2 or later installed. You can check your version by clicking TextMate in the menu bar and selecting About TextMate. If you are using an older version, the comparison feature may not be available.
If the comparison view opens but looks wrong — for example, if the files are not aligned properly or the highlighting is not showing — try closing both files and opening them again, then restarting the comparison. Sometimes TextMate needs to reload the files to display the comparison correctly. If one of your files is very large or contains unusual characters, TextMate may have trouble displaying the comparison; in that case, a dedicated file comparison tool like Kaleidoscope or Meld may work better.
Frequently Asked Questions
Can I compare files that are not currently open in TextMate?
No, both files must be open in TextMate before you can use the comparison feature. Open them as tabs or in separate windows first, then activate the comparison view from the Bundles menu.
Does the comparison feature change my files?
No. The comparison view only shows you the differences — it does not modify, save, or overwrite either file. You remain in control of any edits you make.
What if I want to copy text from the comparison view?
You can select and copy text from either side of the comparison view just as you would in normal editing mode. The comparison view is read-only for the purpose of showing differences, but you can still copy content from it into your editor or elsewhere.
Can I compare more than two files at once?
TextMate's built-in comparison feature shows two files side by side only. If you need to compare three or more files, you would need to compare them in pairs — first file A against file B, then file B against file C — or use a dedicated comparison tool designed for multiple files.
Why are some differences not highlighted?
TextMate highlights line-level differences, so if two lines are marked as different but look the same to you, the difference may be invisible characters like extra spaces, tabs, or line endings. Try clicking on the line to position your cursor and look at the status bar to see the exact character count.