Check displayed buffers for file changes
:checktime
Example
Normal 0 / 2Command-line 1 / 2Normal 2 / 2alpha one
alpha two
alpha threeCursor on line 3, column 1alpha one
alpha two
alpha threeCursor on line 3, column 1externally changed alphaCursor on line 1, column 1Check displayed buffers for file changes.
Buffers
- 2 · alpha.txt Active
loaded · listed · alpha one ↩ alpha two
Command entered · ready to apply
Buffers
- 2 · alpha.txt Active
loaded · listed · alpha one ↩ alpha two
Reloaded alpha.txt from disk.
Buffers
- 2 · alpha.txt Active
loaded · listed · externally changed alpha
Before & after
alpha one
alpha two
alpha threeCursor on line 3, column 1Buffers
- 2 · alpha.txt Active
loaded · listed · alpha one ↩ alpha two
externally changed alphaCursor on line 1, column 1Buffers
- 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.