XeFM has two built-in diff viewers: a file diff that compares two text files side by side, and a directory diff that compares two directory trees recursively. Both open full-window, without leaving XeFM.
Select exactly two files, then press =. The two files may live in the
same pane or one in each pane — XeFM gathers the selection from both panes:
Space to select it.= to open the side-by-side diff.Directories in the selection are ignored; if you don’t end up with exactly two
files, XeFM tells you (Select exactly 2 files to compare). A binary file opens
but shows a [Binary file — cannot display as text] placeholder instead of
content.
Each side keeps its own syntax highlighting (when Pygments is installed), and lines carry their original line numbers. Coloured bands mark what changed, and each band adapts to the active theme (a darker band on a dark theme, a pastel one on a light theme):
| Key | Action |
|---|---|
↑ ↓ |
Scroll one line |
PgUp / PgDn |
Scroll one page |
Home / End |
Jump to the top / bottom |
← → |
Scroll horizontally |
n / N |
Jump to the next / previous change block |
F |
Incremental search — then ↑ / ↓ step between matches |
| Drag the centre gutter | Move the divider between the two panes |
? |
Key help |
Q / Esc |
Close the viewer |
The footer shows the total row and change counts and the key hints. Tabs are expanded to 8-column stops, matching the text viewer.
Press Shift+= to compare the left pane’s current directory against the
right pane’s current directory, recursively. No file selection is needed —
just navigate each pane to the directory you want and press the key.
Useful for comparing a backup against the live directory, verifying two trees are in sync, or reviewing what changed after an update or migration.
The viewer scans progressively so it is responsive on large trees:
The union of both trees is shown side by side. Directories expand and collapse; a centre separator glyph between the two columns carries each node’s verdict:
| Key | Action |
|---|---|
↑ ↓ · PgUp/PgDn · Home/End |
Move the cursor |
→ / ← |
Expand / collapse a directory |
Enter |
Open a directory, or open the per-file diff on a differing file |
n / N |
Jump to the next / previous difference |
Tab |
Switch the active side |
[ / ] |
Move the centre split (or drag the gutter) |
| Click / double-click | Focus a side · open a directory / file diff |
C |
Copy the focused item to the other side |
M |
Move the focused item to the other side |
K / Del |
Delete the focused item (on the active side) |
E |
Merge the two sides in your configured TEXT_DIFF tool |
r |
Rescan |
Q / Esc |
Close the viewer |
The copy / move / delete keys mirror the main file manager’s and run through the
same file-operation engine, so you can reconcile the two trees in place. E
launches the external tool set in TEXT_DIFF (for example vimdiff in a
terminal, or code --diff in the desktop app).
difflib.SequenceMatcher for a line-by-line comparison.= and Shift+= keys, and the file-operation keys inside the directory
diff, are all rebindable in your config’s KEY_BINDINGS.TEXT_DIFF and viewersdoc/dev/TEXT_VIEWER_SYSTEM.md