Vim logo vim online Vim Book Ad

basic Tip #286: Recover after doing something... ugly.

 tip karma   Rating 4/12, Viewed by 916 

created:   July 23, 2002 1:07      complexity:   basic
author:   Little Dragon      as of Vim:   5.7

I was once editing a file and wanted to test something. The test was meant to add a line at the end of the file, from outside vim. All was fine, but instead of >>, I wrote >. You can imagine what happened... :)

If you happen to do something like that, the solution is:

:recover

 rate this tip  Life Changing Helpful Unfulfilling 

<<Don't use the escape key! | Cool trick to change numbers >>

Additional Notes

nitya, July 25, 2002 9:55
This command works only if you have swap file. But in case you don't have swap file, u'll not be able to recover ur file
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
SourceForge Logo