How do I reload the current file?
Quite often I am working with files that are version controlled, so it is possible for changes to be made to them outside of Vim.
What is a quick way to reload the file without having to close and reopen Vim? And is there a way to do this automatically?
The command you want is
:edit). If you use
:edit!it will discard local changes and reload.
You can also have vim do this automatically with
set autoreadin your vimrc.
@AaronH. thank you for that! i usually have hundreds of buffers open at a time and when switching branches, I usually just close down vim and restart to refresh all of the buffers with new contents. This will be a major timesaver!