Vim – Refresh Changed Content of File Opened in vi(m)

vim

I have a config-file that I keep open in vim, but that sometimes gets changed on disk, without these changes being reflected on the terminal. Can I refresh the content on the screen without closing and re-opening the file? If so, how?

Best Answer

You can use the :edit command, without specifying a file name, to reload the current file. If you have made modifications to the file, you can use :edit! to force the reload of the current file (you will lose your modifications).

The command :edit can be abbreviated by :e. The force-edit can thus be done by :e!

Related Question