Wikia

Vim Tips Wiki

Changes: Recovering files

Edit

Back to page

(Remove html character entities)
(change "anon" author to blank; trim "created" date; minor manual clean)
 
Line 3: Line 3:
 
|previous=49
 
|previous=49
 
|next=51
 
|next=51
|created=March 14, 2001
+
|created=2001
 
|complexity=basic
 
|complexity=basic
|author=Anon
+
|author=
 
|version=5.7
 
|version=5.7
 
|rating=23/10
 
|rating=23/10
Line 12: Line 12:
 
}}
 
}}
 
If the power fails, or your computer crashes, any file you were editing probably won't be saved. However, when the computer is restarted, you should be able to recover the file by typing:
 
If the power fails, or your computer crashes, any file you were editing probably won't be saved. However, when the computer is restarted, you should be able to recover the file by typing:
+
<pre>
vim -r <filename>
+
vim -r <filename>
  +
</pre>
   
 
where <filename> is the name of the file you were editing at the time of the crash.
 
where <filename> is the name of the file you were editing at the time of the crash.
   
 
If you were editing without a file name, enter:
 
If you were editing without a file name, enter:
+
<pre>
vim -r ""
+
vim -r ""
  +
</pre>
   
 
You can list the recoverable files:
 
You can list the recoverable files:
+
<pre>
vim -r
+
vim -r
  +
</pre>
   
 
Each of these commands should be executed in the directory where you were when the crash occurred.
 
Each of these commands should be executed in the directory where you were when the crash occurred.

Latest revision as of 02:56, December 4, 2009

Tip 50 Printable Monobook Previous Next

created 2001 · complexity basic · version 5.7


If the power fails, or your computer crashes, any file you were editing probably won't be saved. However, when the computer is restarted, you should be able to recover the file by typing:

vim -r <filename>

where <filename> is the name of the file you were editing at the time of the crash.

If you were editing without a file name, enter:

vim -r ""

You can list the recoverable files:

vim -r

Each of these commands should be executed in the directory where you were when the crash occurred.

ReferencesEdit

CommentsEdit

Around Wikia's network

Random Wiki