Tuesday, March 8, 2011

how to reload the current file in Vim vi

You can use the following command, without specifying a file name, to reload the current file:

:edit

or shortcut
:e

If you have made modifications to the file, you can use the following command to force the reload of the current file (you will lose your modifications):

:edit!

or shortcut
:e!

For more information, read:

:help :edit
:help :edit!
:help 'confirm'

Reference:
http://stevemorin.blogspot.com/2005/11/vim-vi-how-to-reload-file-your-editing.html

No comments: