Lines Matching refs:file
10 chapter shows you how to get your work back and explains how the swap file is
14 |11.2| Where is the swap file?
25 In most cases recovering a file is quite simple, assuming you know which file
26 you were editing (and the harddisk is still working). Start Vim on the file,
31 Vim will read the swap file (used to store text you were editing) and may read
32 bits and pieces of the original file. If Vim recovered your changes you will
33 see these messages (with different file names, of course):
35 Using swap file ".help.txt.swp" ~
36 Original file "~/vim/runtime/doc/help.txt" ~
38 (You might want to write out this file under another name ~
39 and run diff with the original file to check for changes) ~
40 You may want to delete the .swp file now. ~
42 To be on the safe side, write this file under another name: >
46 Compare the file with the original file to check if you ended up with what you
53 Watch out for the original file to contain a more recent version (you saved
54 the file just before the computer crashed). And check that no lines are
59 If the recovery resulted in text that is exactly the same as the file
62 Using swap file ".help.txt.swp" ~
63 Original file "~/vim/runtime/doc/help.txt" ~
64 Recovery completed. Buffer contents equals file contents. ~
65 You may want to delete the .swp file now. ~
68 file after making changes. It is safe to delete the swap file now.
76 If you were editing without a file name, give an empty string as argument: >
80 You must be in the right directory, otherwise Vim can't find the swap file.
83 *11.2* Where is the swap file?
85 Vim can store the swap file in several places. Normally it is in the same
86 directory as the original file. To find it, change to the directory of the
87 file, and use: >
92 directories where the swap file for files in the current directory may be
101 file name: ~mool/vim/vim6/src/main.c ~
122 If you know which swap file needs to be used, you can recover by giving the
123 swap file name. Vim will then find out the name of the original file from
124 the swap file.
129 This is also handy when the swap file is in another directory than expected.
132 If this still does not work, see what file names Vim reports and rename the
134 put the swap file.
137 Vim tries to find the swap file by searching the directories in the
140 invalid), Vim does a desperate try to find the file "filename.swp".
142 itself to be able to recover the file.
148 start editing a file, expecting the contents of the file to show up. Instead,
152 Found a swap file by the name ".main.c.swp" ~
154 file name: ~mool/vim/vim6/src/main.c ~
158 While opening file "main.c" ~
161 (1) Another program may be editing the same file. ~
163 different instances of the same file when making changes. ~
166 (2) An edit session for this file crashed. ~
169 If you did this already, delete the swap file ".main.c.swp" ~
172 You get this message, because, when starting to edit a file, Vim checks if a
173 swap file already exists for that file. If there is one, there must be
176 1. Another edit session is active on this file. Look in the message for the
181 The text "(still running)" indicates that the process editing this file
183 get this extra hint. When editing a file over a network, you may not see
186 If there is another Vim editing the same file, continuing to edit will
187 result in two versions of the same file. The one that is written last will
191 2. The swap file might be the result from a previous crash of Vim or the
193 swap file is newer than the file you were editing, and this line appears:
198 If the date of the file is newer than the date of the swap file, then
200 but didn't delete the swap file?), or else the file was saved before the
201 crash but after the last write of the swap file (then you're lucky: you
202 don't even need that old swap file). Vim will warn you for this with this
205 NEWER than swap file! ~
208 NOTE that in the following situation Vim knows the swap file is not useful and
210 - The file is a valid swap file (Magic number is correct).
211 - The flag that the file was modified is not set.
224 will appear under the name of the swap file. This can be good or bad,
228 changes to the file. Then a directory listing of the swap file will show
231 It is slightly bad if you don't have read permission for the swap file. You
232 may want to view the file read-only, or quit. On multi-user systems, if you
235 else you might want to find out who last edited (or is editing) the file and
239 containing the swap file. Fortunately, this almost never happens.
240 You may want to view the file read-only at first (if you can), to see the
242 that file, be prepared to redo your last changes.
249 Swap file ".main.c.swp" already exists! ~
252 O Open the file readonly. Use this when you just want to view the file and
254 else is editing the file, but you just want to look in it and not make
257 E Edit the file anyway. Use this with caution! If the file is being edited
258 in another Vim, you might end up with two versions of the file. Vim will
261 R Recover the file from the swap file. Use this if you know that the swap
262 file contains changes that you want to recover.
264 Q Quit. This avoids starting to edit the file. Use this if there is another
265 Vim editing the same file.
267 files in several windows, Vim quits only if there is a swap file for the
268 first one. When using an edit command, the file will not be loaded and you
269 are taken back to the previously edited file.
275 D Delete the swap file. Use this when you are sure you no longer need it.
276 For example, when it doesn't contain changes, or when the file itself is
277 newer than the swap file.
279 swap file does not appear to be running.
282 support it), you will have to do it manually. To recover the file, use this
288 Vim cannot always detect that a swap file already exists for a file. This is
290 or when the path name for the file is different when editing it on different
296 For remarks about encryption and the swap file, see |:recover-crypt|.
297 For programmatic access to the swap file, see |swapinfo()|.
302 |swap-file| An explanation about where the swap file will be created and
304 |:preserve| Manually flushing the swap file to disk.
305 |:swapname| See the name of the swap file for the current file.
306 'updatecount' Number of key strokes after which the swap file is flushed to
308 'updatetime' Timeout after which the swap file is flushed to disk.
309 'swapsync' Whether the disk is synced when the swap file is flushed.
310 'directory' List of directory names where to store the swap file.
311 'maxmem' Limit for memory usage before writing text to the swap file.