Vim Recall繁體中文

Update 'diff' buffers

:diffupdate

Example

Normal 0 / 2

Update 'diff' buffers.

Diff state

Highlight
stale after line-2 edit
Before & after

Before

Diff state

Highlight
stale after line-2 edit

After

Recomputed diff

Line 2
old ↔ new (DiffChange / DiffText)
Lines 1,3
equal

Documentation-backed illustration. +diff; both displayed windows are diff-enabled in the same tab; diffopt=filler,closeoff,inline:char excludes internal, diffexpr is empty and a compatible external diff program works; the completed last comparison had both buffers equal, then only right.txt line 2 changed from old to new without adding or deleting lines, leaving the cached comparison stale; no DiffUpdated autocommands alter the shown state. :diffupdate recomputes the diff regions for the two diff windows; buffer contents are unchanged. Primary help: :diffupdate.

Sample buffer
one
new
three
Cursor on line 1, column 1
Details & Vim help

Update 'diff' buffers. 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 :dif[fupdate] 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.