Lines Matching refs:file
20 Previous chapter: |usr_22.txt| Finding the file to edit
34 This means that if you try to move a file from one system to another, you
36 different file formats and handles things properly behind your back.
38 when a new file is edited. The following command, for example, tells Vim to
43 You will notice the format in the message you get when editing a file. You
44 don't see anything if you edit a native file format. Thus editing a Unix file
45 on Unix won't result in a remark. But when you edit a dos file, Vim will
50 For a Mac file you would see "[mac]".
51 The detected file format is stored in the 'fileformat' option. To see
70 The result is that it's not possible to be 100% sure whether a file
71 containing both <CR> and <NL> characters is a Mac or a Unix file. Therefore,
72 Vim assumes that on Unix you probably won't edit a Mac file, and doesn't check
73 for this type of file. To check for this format anyway, add "mac" to
78 Then Vim will take a guess at the file format. Watch out for situations where
84 If you use the good old Vi and try to edit an MS-DOS format file, you will
86 detection avoids this. Suppose you do want to edit the file that way? Then
89 :edit ++ff=unix file.txt
100 You can use the 'fileformat' option to convert from one file format to
101 another. Suppose, for example, that you have an MS-DOS file named README.TXT
103 file: >
106 Vim will recognize this as a dos format file. Now change the file format to
112 The file is written in Unix format.
117 Someone sends you an e-mail message, which refers to a file by its URL. For
123 You could start a program to download the file, save it on your local disk and
131 the file, download it and edit the copy. To open the file in a new window use
136 might want to try the manual way of downloading the file.
150 Vim detects these URLs for each command that starts editing a new file, also
162 encrypt the file for you, which gives you some protection.
163 To start editing a new file with encryption, use the "-x" argument to start
168 Vim prompts you for a key used for encrypting and decrypting the file:
178 You can now edit this file normally and put in all your secrets. When you
179 finish editing the file and tell Vim to exit, the file is encrypted and
181 When you edit the file with Vim, it will ask you to enter the same key
183 ":edit" command. Vim adds a magic string to the file by which it recognizes
184 that the file was encrypted.
185 If you try to view this file using another program, all you get is garbage.
186 Also, if you edit the file with Vim and enter the wrong key, you get garbage.
193 To disable the encryption of a file, set the 'key' option to an empty string:
197 The next time you write the file this will be done without encryption.
213 expert with lots of time on his hands. The text in the swap file and the undo
214 file is also encrypted. However, this is done block-by-block and may reduce
215 the time needed to crack a password. You can disable the swap file, but then
217 memory only. The undo file can be disabled with the only disadvantage that
219 To avoid using a swap file, supply the -n argument on the command line.
220 For example, to edit the encrypted file "file.txt" without a swap file use the
223 vim -x -n file.txt
225 When already editing a file, the swapfile can be disabled with: >
229 Since there is no swapfile, recovery will be impossible. Save the file a bit
232 While the file is in memory, it is in plain text. Anyone with privilege can
233 look in the editor's memory and discover the contents of the file.
234 If you use a viminfo file, be aware that the contents of text registers are
236 If you really want to secure the contents of a file, edit it only on a
244 there are a few restrictions. But you can read a file, change a character and
246 the file is identical otherwise.
254 automatic formatting of lines. And files are always read in Unix file format.
260 Many characters in the file will be unprintable. To see them in Hex format: >
270 There might not be many line breaks in the file. To get some overview switch
278 To see on which byte you are in the file use this command: >
286 The last two numbers are the byte position in the file and the total number of
289 To move to a specific byte in the file, use the "go" command. For
298 You can do this in Vim by first converting the file with the "xxd" program.
300 First edit the file in binary mode: >
304 Now convert the file to a hex dump with xxd: >
329 This is easy: You can edit a compressed file just like any other file. The
330 "gzip" plugin takes care of decompressing the file when you edit it. And