annotate runtime/doc/recover.txt @ 19543:86f834bd45fc

Added tag v8.2.0328 for changeset 9e428147e4eed902e0a5b9a3ea29169686a3e5a7
author Bram Moolenaar <Bram@vim.org>
date Fri, 28 Feb 2020 22:30:10 +0100
parents 130acb903dbe
children 350e1d3131d8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18879
af69c9335223 Vim 8.2 release
Bram Moolenaar <Bram@vim.org>
parents: 16610
diff changeset
1 *recover.txt* For Vim version 8.2. Last change: 2019 May 07
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 VIM REFERENCE MANUAL by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 Recovery after a crash *crash-recovery*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 You have spent several hours typing in that text that has to be finished
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 next morning, and then disaster strikes: Your computer crashes.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 DON'T PANIC!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 You can recover most of your changes from the files that Vim uses to store
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 the contents of the file. Mostly you can recover your work with one command:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 vim -r filename
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 1. The swap file |swap-file|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 2. Recovery |recovery|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 1. The swap file *swap-file*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 Vim stores the things you changed in a swap file. Using the original file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 you started from plus the swap file you can mostly recover your work.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 You can see the name of the current swap file being used with the command:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 :sw[apname] *:sw* *:swapname*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
14864
40ef13331e02 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14421
diff changeset
31 Or you can use the |swapname()| function, which also allows for seeing the
40ef13331e02 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14421
diff changeset
32 swap file name of other buffers.
40ef13331e02 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14421
diff changeset
33
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 The name of the swap file is normally the same as the file you are editing,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 with the extension ".swp".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 - On Unix, a '.' is prepended to swap file names in the same directory as the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 edited file. This avoids that the swap file shows up in a directory
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 listing.
18972
130acb903dbe Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 18879
diff changeset
39 - On MS-Windows machines and when the 'shortname' option is on, any '.' in the
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 original file name is replaced with '_'.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 - If this file already exists (e.g., when you are recovering from a crash) a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 warning is given and another extension is used, ".swo", ".swn", etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 - An existing file will never be overwritten.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 - The swap file is deleted as soon as Vim stops editing the file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 Technical: The replacement of '.' with '_' is done to avoid problems with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 MS-DOS compatible filesystems (e.g., crossdos, multidos). If Vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 is able to detect that the file is on an MS-DOS-like filesystem, a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 flag is set that has the same effect as the 'shortname' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 This flag is reset when you start editing another file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 *E326*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 If the ".swp" file name already exists, the last character is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 decremented until there is no file with that name or ".saa" is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 reached. In the last case, no swap file is created.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 By setting the 'directory' option you can place the swap file in another place
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 than where the edited file is.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 Advantages:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 - You will not pollute the directories with ".swp" files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 - When the 'directory' is on another partition, reduce the risk of damaging
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 the file system where the file is (in a crash).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 Disadvantages:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 - You can get name collisions from files with the same name but in different
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 directories (although Vim tries to avoid that by comparing the path name).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 This will result in bogus ATTENTION warning messages.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 - When you use your home directory, and somebody else tries to edit the same
9
4102fb4ea781 updated for version 7.0002
vimboss
parents: 7
diff changeset
67 file, he will not see your swap file and will not get the ATTENTION warning
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 message.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 On the Amiga you can also use a recoverable ram disk, but there is no 100%
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 guarantee that this works. Putting swap files in a normal ram disk (like RAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 on the Amiga) or in a place that is cleared when rebooting (like /tmp on Unix)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 makes no sense, you will lose the swap file in a crash.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 If you want to put swap files in a fixed place, put a command resembling the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 following ones in your .vimrc:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 :set dir=dh2:tmp (for Amiga)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 :set dir=~/tmp (for Unix)
18972
130acb903dbe Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 18879
diff changeset
78 :set dir=c:\\tmp (for Win32)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 This is also very handy when editing files on floppy. Of course you will have
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 to create that "tmp" directory for this to work!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 For read-only files, a swap file is not used. Unless the file is big, causing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 the amount of memory used to be higher than given with 'maxmem' or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 'maxmemtot'. And when making a change to a read-only file, the swap file is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 created anyway.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
5737
e25a04c1c515 updated for version 7.4.213
Bram Moolenaar <bram@vim.org>
parents: 5294
diff changeset
87 The 'swapfile' option can be reset to avoid creating a swapfile. And the
e25a04c1c515 updated for version 7.4.213
Bram Moolenaar <bram@vim.org>
parents: 5294
diff changeset
88 |:noswapfile| modifier can be used to not create a swapfile for a new buffer.
e25a04c1c515 updated for version 7.4.213
Bram Moolenaar <bram@vim.org>
parents: 5294
diff changeset
89
5814
755931e042e4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5763
diff changeset
90 :nos[wapfile] {command} *:nos* *:noswapfile*
5737
e25a04c1c515 updated for version 7.4.213
Bram Moolenaar <bram@vim.org>
parents: 5294
diff changeset
91 Execute {command}. If it contains a command that loads a new
e25a04c1c515 updated for version 7.4.213
Bram Moolenaar <bram@vim.org>
parents: 5294
diff changeset
92 buffer, it will be loaded without creating a swapfile and the
e25a04c1c515 updated for version 7.4.213
Bram Moolenaar <bram@vim.org>
parents: 5294
diff changeset
93 'swapfile' option will be reset. If a buffer already had a
e25a04c1c515 updated for version 7.4.213
Bram Moolenaar <bram@vim.org>
parents: 5294
diff changeset
94 swapfile it is not removed and 'swapfile' is not reset.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 Detecting an existing swap file ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 You can find this in the user manual, section |11.3|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 Updating the swapfile ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 The swap file is updated after typing 200 characters or when you have not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 typed anything for four seconds. This only happens if the buffer was
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 changed, not when you only moved around. The reason why it is not kept up to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 date all the time is that this would slow down normal work too much. You can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 change the 200 character count with the 'updatecount' option. You can set
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 the time with the 'updatetime' option. The time is given in milliseconds.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 After writing to the swap file Vim syncs the file to disk. This takes some
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 time, especially on busy Unix systems. If you don't want this you can set the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 'swapsync' option to an empty string. The risk of losing work becomes bigger
18972
130acb903dbe Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 18879
diff changeset
113 though. On some non-Unix systems (MS-Windows, Amiga) the swap file won't be
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 written at all.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 If the writing to the swap file is not wanted, it can be switched off by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 setting the 'updatecount' option to 0. The same is done when starting Vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 with the "-n" option. Writing can be switched back on by setting the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 'updatecount' option to non-zero. Swap files will be created for all buffers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 when doing this. But when setting 'updatecount' to zero, the existing swap
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 files will not be removed, it will only affect files that will be opened
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 after this.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 If you want to make sure that your changes are in the swap file use this
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 command:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 *:pre* *:preserve* *E313* *E314*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 :pre[serve] Write all text for all buffers into swap file. The
164
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 9
diff changeset
129 original file is no longer needed for recovery.
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 9
diff changeset
130 This sets a flag in the current buffer. When the '&'
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 9
diff changeset
131 flag is present in 'cpoptions' the swap file will not
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 9
diff changeset
132 be deleted for this buffer when Vim exits and the
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 9
diff changeset
133 buffer is still loaded |cpo-&|.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 A Vim swap file can be recognized by the first six characters: "b0VIM ".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 After that comes the version number, e.g., "3.0".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137
593
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
138
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
139 Links and symbolic links ~
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
140
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
141 On Unix it is possible to have two names for the same file. This can be done
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
142 with hard links and with symbolic links (symlinks).
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
143
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
144 For hard links Vim does not know the other name of the file. Therefore, the
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
145 name of the swapfile will be based on the name you used to edit the file.
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
146 There is no check for editing the same file by the other name too, because Vim
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
147 cannot find the other swapfile (except for searching all of your harddisk,
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
148 which would be very slow).
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
149
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
150 For symbolic links Vim resolves the links to find the name of the actual file.
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
151 The swap file name is based on that name. Thus it doesn't matter by what name
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
152 you edit the file, the swap file name will normally be the same. However,
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
153 there are exceptions:
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
154 - When the directory of the actual file is not writable the swapfile is put
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
155 elsewhere.
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
156 - When the symbolic links somehow create a loop you get an *E773* error
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
157 message and the unmodified file name will be used. You won't be able to
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
158 save your file normally.
d220eb88e4e4 updated for version 7.0168
vimboss
parents: 164
diff changeset
159
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 2. Recovery *recovery* *E308* *E311*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 Basic file recovery is explained in the user manual: |usr_11.txt|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 Another way to do recovery is to start Vim and use the ":recover" command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 This is easy when you start Vim to edit a file and you get the "ATTENTION:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 Found a swap file ..." message. In this case the single command ":recover"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 will do the work. You can also give the name of the file or the swap file to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 the recover command:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 *:rec* *:recover* *E305* *E306* *E307*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 :rec[over] [file] Try to recover [file] from the swap file. If [file]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 is not given use the file name for the current
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 buffer. The current contents of the buffer are lost.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 This command fails if the buffer was modified.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 :rec[over]! [file] Like ":recover", but any changes in the current
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 buffer are lost.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 *E312* *E309* *E310*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 Vim has some intelligence about what to do if the swap file is corrupt in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 some way. If Vim has doubt about what it found, it will give an error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 message and insert lines with "???" in the text. If you see an error message
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 while recovering, search in the file for "???" to see what is wrong. You may
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 want to cut and paste to get the text you need.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 The most common remark is "???LINES MISSING". This means that Vim cannot read
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 the text from the original file. This can happen if the system crashed and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 parts of the original file were not written to disk.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 Be sure that the recovery was successful before overwriting the original
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 file or deleting the swap file. It is good practice to write the recovered
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 file elsewhere and run 'diff' to find out if the changes you want are in the
2033
de5a43c5eedc Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
193 recovered file. Or use |:DiffOrig|.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 Once you are sure the recovery is ok delete the swap file. Otherwise, you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 will continue to get warning messages that the ".swp" file already exists.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198
2267
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
199
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
200 ENCRYPTION AND THE SWAP FILE *:recover-crypt*
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
201
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
202 When the text file is encrypted the swap file is encrypted as well. This
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
203 makes recovery a bit more complicated. When recovering from a swap file and
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
204 encryption has been used, you will be asked to enter one or two crypt keys.
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
205
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
206 If the text file does not exist you will only be asked to enter the crypt key
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
207 for the swap file.
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
208
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
209 If the text file does exist, it may be encrypted in a different way than the
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
210 swap file. You will be asked for the crypt key twice:
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
211
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
212 Need encryption key for "/tmp/tt" ~
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
213 Enter encryption key: ****** ~
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
214 "/tmp/tt" [crypted] 23200L, 522129C ~
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
215 Using swap file "/tmp/.tt.swp" ~
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
216 Original file "/tmp/tt" ~
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
217 Swap file is encrypted: "/tmp/.tt.swp" ~
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
218 If you entered a new crypt key but did not write the text file, ~
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
219 enter the new crypt key. ~
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
220 If you wrote the text file after changing the crypt key press enter ~
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
221 to use the same key for text file and swap file ~
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
222 Enter encryption key: ~
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
223
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
224 You can be in one of these two situations:
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
225
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
226 1. The encryption key was not changed, or after changing the key the text file
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
227 was written. You will be prompted for the crypt key twice. The second
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
228 time you can simply press Enter. That means the same key is used for the
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
229 text file and the swap file.
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
230 2. You entered a new encryption key, but did not save the text file. Vim will
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
231 then use the new key for the swap file, and the text file will still be
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
232 encrypted with the old key. At the second prompt enter the new key.
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
233
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
234 Note that after recovery the key of the swap file will be used for the text
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
235 file. Thus if you write the text file, you need to use that new key.
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
236
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
237
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
238 vim:tw=78:ts=8:noet:ft=help:norl: