Skip to content

Compare two files ​

Open two files side by side, see what differs, move changes from one side to the other, and save the result.

Open the comparison ​

  1. On the home screen, select Files.

  2. Give each side a file: type or paste a path (~ works), select Browse, or drop a file on the Left or Right card.

    Dropping two files anywhere on the home screen fills both sides.

  3. Select Compare.

From a terminal, delta-view old.txt new.txt opens the same view.

To compare text that is not in a file, select Text instead, paste into Left text and Right text, and select Compare. Ctrl + Shift + V compares the clipboard from anywhere in the app.

Read the diff ​

  • Each pane shows one file, with line numbers. The pane header shows the file's path.
  • Changed lines are filled with colour and carry a marker: + added, − removed, ~ changed. Inside a changed line, the words that differ are highlighted.
  • The toolbar counts the added, removed and changed lines, and shows your position, for example "Change 2 of 7". When nothing differs it says No differences.
  • The minimap on the edge shows where the changes are in the whole file. Drag it to scroll.
  • The status bar shows each side's encoding, line endings and line count, and the compare rules in use.
To do thisUse
Next or previous changeAlt + ↓, Alt + ↑
Find text in both filesCtrl + F, then F3 and Shift + F3
Go to a lineCtrl + G
Wrap long linesAlt + W
Hide unchanged linesAlt + U
Bigger or smaller textCtrl + +, Ctrl + −, reset with Ctrl + 0
Compare again from diskF5

With Hide unchanged lines on, long runs of identical lines collapse into a row such as "120 unchanged lines". Select the row to show those lines again. Hiding works in view mode only.

Copy or delete a change ​

The band between the panes has an arrow beside each change.

  1. Move to the change with Alt + ↓.

  2. Copy it across:

    • To the right: select the right-pointing arrow, or press Alt + →.
    • To the left: select the left-pointing arrow, or press Alt + ←.
  3. To delete the change from one side instead, hold Shift and select the arrow on that side.

    Right-clicking the band opens a menu with Copy to the right, Copy to the left, Delete on the left and Delete on the right.

  4. Press Ctrl + S to save.

Ctrl + Z undoes each step and Ctrl + Shift + Z redoes it. Nothing is written to disk until you save.

Edit in place ​

  1. Select Edit in the toolbar, or press Ctrl + E.

  2. Type in either pane. The diff updates as you type.

  3. Select View, or press Ctrl + E again, to go back to the read-only view.

Save ​

A side with unsaved edits shows a dot in its pane header, and the toolbar shows ● unsaved.

  • Ctrl + S saves both sides.
  • The Save button in a pane header saves that side only. For pasted text it reads Save as… and asks for a file. For a path that does not exist yet it reads Create.
  • Closing a tab or quitting with unsaved edits asks Save changes to …? with Cancel, Don't save and Save.

DeltaView keeps each file's encoding and line endings when it saves. To change them, use the two menus on that side of the status bar: the encoding (UTF-8, UTF-8 with BOM, UTF-16 LE, UTF-16 BE, Latin-1) and the line endings (LF or CRLF). The choice applies to the next save.

WARNING

Saving overwrites the file on disk. Undo works until you close the tab, not after. If the file matters, keep a copy or have it under version control before you copy changes into it.

If a file changes on disk while it is open, a bar says "… changed on disk." Choose Reload to take the new contents or Keep mine to keep what is in the pane.

Choose which differences count ​

Compare rules decide what is treated as a change. Open the compare rules menu in the toolbar (its tooltip starts with Compare rules):

RuleEffect
Compare all whitespaceEvery space and tab counts. This is the default.
Ignore trailing whitespaceSpaces and tabs at the end of a line do not count.
Ignore changes in whitespaceA different amount of whitespace does not count.
Ignore all whitespaceWhitespace never counts.
Ignore caseHello and hello compare equal.
Ignore line endings (CRLF / LF)Windows and Unix line endings compare equal. On by default.
Ignore blank linesEmpty lines are left out.

Use the default rules returns to the rules set in Settings under Comparison rules. The menu changes this view only; Settings changes the rules for new comparisons.

Share the differences ​

The More menu in the toolbar has:

  • Copy as unified diff: puts a patch on the clipboard.
  • Save patch…: writes a .patch file.
  • Copy left text and Copy right text.
  • Reload from disk, Go to line…, and the text size commands.

Limits ​

  • A file larger than 8 MB is not shown as a text diff.
  • Binary files show "Binary files — no text diff available."
  • Two image files open in the image view, and two JSON, YAML, CSV or TSV files open in the structured view. See Compare images and structured data.

Next steps ​