If you have not yet modified the file, but it is open, then you update it outside of Vim, then Vim should prompt you to reload the file, or even (if only the timestamp changed) update automatically for you. But Vim only checks for this when it runs an external command, or when it gains input focus after having lost input focus (which only happens reliably in gVim and in a few terminal versions). If you are using terminal Vim, then you will probably need to manually add calls to
:checktime in an appropriate autocmd, for example,
BufEnter, or another event that fires frequently. See this example of autocmds to run :checktime and also some of the other answers on that question for details.
Once you have Vim reliably checking for modified files, you can also customize what Vim does when it detects a modified timestamp, using the
FileChangedShell autocmd event. This autocmd lets you set the variable
v:fcs_choice to "reload", "ask", or "" (empty string) to tell Vim what to do, and you could probably do something crazy like start a diff with the on-disk file if you wanted. Vim can detect and separately act on the following scenarios (stored in
deleted file no longer exists
conflict file contents, mode or timestamp was
changed and buffer is modified
changed file contents has changed
mode mode of file changed
time only file timestamp changed
See http://vim.wikia.com/wiki/File_no_longer_available_-_mark_buffer_modified for a fully developed example of using the FileChangedShell event.