Vim vi how to reload a file your editing

5.8. How do I reload/re-edit the current file?

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).

For more information, read

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


from - http://vimdoc.sourceforge.net/cgi-bin/vimfaq2html3.pl#5.8

Comments

Anonymous said…
awesome, thanks!
Mark said…
just what i was looking for, thanks!
RobertMarkBram said…
Thanks for this - very helpful. Also, I use this to automatically reload files without asking me:
:set autoread

Rob
:)
Chad said…
Wow that is very useful! Everytime I learn something new in vim I wonder how I ever lived without it...
Manish said…
hey thanks yar.. was looking for this got it here.
phylae said…
Thanks. But you might want to change "your" to "you're."
mistik1 said…
6 years later and still very useful.
Thanks
Abhir said…
Extremely useful small tip.
Matsukubokkuri said…
useful! thanks.
thanks, help.
me_me_me said…
you are dammit
Japan Shah said…
Cool ! Hope it will remain the first result for "vim reload current file" search ! Thanks you've saved time of lots of vim users !

appreciated !
Anonymous said…
Indeed. This post is from 2005 and I'm learning this on 2013. Still useful. Thank you!
Bernard Sanders said…
This comment has been removed by the author.
Andrew Barchuk said…
`e!` as for short :D
Elijah Baye said…
I've discovered this is a workaround for a bug in Vim folding.

Popular posts from this blog