Opening the Diff Viewer
To compare two files:
- Select a file in the left pane
- Select a file in the right pane (typically a file with the same name, or any file you want to compare)
- Press F9
The diff viewer will open showing both files side by side with differences highlighted.
Understanding the Diff View
The diff viewer shows both files side by side with changes highlighted:
| Green background | Lines added (only in right file) |
| Red background | Lines removed (only in left file) |
| Yellow background | Lines modified (changed between files) |
| No highlight | Unchanged lines |
Navigating Differences
| Next difference | Cmd+Down or N |
| Previous difference | Cmd+Up or P |
| Jump to line | Cmd+G |
| Scroll both panels | Scroll wheel (synced) |
Diff Statistics
The status bar shows:
- Total number of differences
- Lines added / removed / modified
- Current difference position (e.g., "3 of 12")
Supported File Types
Visual diff works best with text-based files:
- Source code (.swift, .js, .py, .java, etc.)
- Configuration files (.json, .xml, .yaml, .plist)
- Text documents (.txt, .md, .csv)
- Shell scripts (.sh, .bash, .zsh)
Note: Binary files (images, compiled code, archives) cannot be compared with visual diff. For these, only a basic "files are identical/different" check is available.
Comparing Directory Contents
To compare two directories:
- Navigate to one directory in the left pane
- Navigate to the other directory in the right pane
- Look at the file listing - files unique to each side are marked
- Select matching files and use F9 to compare their contents
Keyboard Shortcuts in Diff View
| Close diff view | Escape |
| Toggle line numbers | Cmd+L |
| Toggle whitespace visibility | Cmd+Shift+W |
| Copy selection | Cmd+C |