Diff Mode
vimdiff and :diffthis โ visualize and edit changes side-by-side.
Vim has a built-in diff view: vimdiff a b opens two files in vertical splits with synchronized scrolling and highlighted differences. ]c and [c jump between hunks; do and dp pull and push changes.
Vim has a real diff tool baked in. Launch with vimdiff a b from the shell, or :diffsplit other.txt to compare with the current buffer.
| Key | Action |
|---|---|
| ]c | Jump to next change |
| [c | Jump to previous change |
| do | Diff Obtain โ pull change FROM the other file |
| dp | Diff Put โ push change TO the other file |
| :diffupdate | Re-scan for changes after edits |
| :diffoff | Exit diff mode for current buffer |
Watch
- ๐บ #0473 The Useless _ Key (not yet published)
- ๐บ #0475 Ctrl-O in Insert Mode (not yet published)
See also: The {key:[} and {key:]} Family