Show differences with another file
Example
Normal 0 / 2Command-line 1 / 2Normal 2 / 2same first
old value
same lastCursor on line 3, column 1same first
old value
same lastCursor on line 3, column 1same first
new value
same lastCursor on line 3, column 1Show differences with another file.
Windows
- Window 1 · alpha.txt Active
80 columns × 23 lines
Buffers
- 2 · alpha.txt Active
loaded · listed · same first ↩ old value
Option · diff
- Local diff
0- Global diff
0
Command entered · ready to apply
Windows
- Window 1 · alpha.txt Active
80 columns × 23 lines
Buffers
- 2 · alpha.txt Active
loaded · listed · same first ↩ old value
Option · diff
- Local diff
0- Global diff
0
Show differences with another file
Windows
- Window 2 · beta.txt Active
80 columns × 11 lines · diff
- Window 1 · alpha.txt
80 columns × 10 lines · diff
Buffers
- 2 · alpha.txt
loaded · listed · alternate · same first ↩ old value- 3 · beta.txt Active
loaded · listed · same first ↩ new value
Option · diff
- Local diff
1- Global diff
0
Before & after
same first
old value
same lastCursor on line 3, column 1Windows
- Window 1 · alpha.txt Active
80 columns × 23 lines
Buffers
- 2 · alpha.txt Active
loaded · listed · same first ↩ old value
Option · diff
- Local diff
0- Global diff
0
same first
new value
same lastCursor on line 3, column 1Windows
- Window 2 · beta.txt Active
80 columns × 11 lines · diff
- Window 1 · alpha.txt
80 columns × 10 lines · diff
Buffers
- 2 · alpha.txt
loaded · listed · alternate · same first ↩ old value- 3 · beta.txt Active
loaded · listed · same first ↩ new value
Option · diff
- Local diff
1- Global diff
0
Start in Normal mode. Two temporary files differ on line two. This verified example requires the trusted local /usr/bin/diff utility, invoked with fixed arguments on Vim-owned temporary files.
Details & Vim help
Example replayed in Vim
Show differences with another file. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. The index spelling :diffs[plit] puts the optional abbreviation suffix in square brackets; those brackets are not typed. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.