Wikia

Vim Tips Wiki

Changes: Recover overwritten file

Edit

Back to page

m (Reverted edits by Emprego.curitiba (talk | block) to last version by JohnBot)
(Adjust previous/next navigation + minor manual clean)
 
Line 2: Line 2:
 
|id=286
 
|id=286
 
|previous=285
 
|previous=285
|next=287
+
|next=288
|created=July 23, 2002
+
|created=2002
 
|complexity=basic
 
|complexity=basic
 
|author=Little Dragon
 
|author=Little Dragon

Latest revision as of 02:10, May 16, 2012

Tip 286 Printable Monobook Previous Next

created 2002 · complexity basic · author Little Dragon · version 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 >> to append the output to the file, I wrote > to replace the file with the output by mistake.

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

:recover

This command only works if you have a swap file. If you do not have a swap file, the recover command will not work.

CommentsEdit

Around Wikia's network

Random Wiki