Vim Recall繁體中文

Check displayed buffers for file changes

:checktime

Example

Normal 0 / 2
alpha one
alpha two
alpha three
Cursor on line 3, column 1

Check displayed buffers for file changes.

Buffers

2 · alpha.txt Active
loaded · listed · alpha one ↩ alpha two
Before & after
Before
alpha one
alpha two
alpha three
Cursor on line 3, column 1

Buffers

2 · alpha.txt Active
loaded · listed · alpha one ↩ alpha two
After
externally changed alpha
Cursor on line 1, column 1

Buffers

2 · alpha.txt Active
loaded · listed · externally changed alpha

Start in Normal mode. Only the temporary alpha.txt, beta.txt, gamma.txt and delta.txt files exist in this example directory. autoread is enabled, and alpha.txt was changed on disk after it was opened; :checktime reloads that externally changed temporary file.

Details & Vim help

Example replayed in Vim

Without an argument, :checktime checks buffers displayed in windows for external file changes. Give a buffer number or name to check a specific loaded buffer, including a hidden one. With 'autoread' enabled, Vim can reload an unmodified buffer automatically.