comparison runtime/doc/editing.txt @ 42:c75153d791d0

updated for version 7.0026
author vimboss
date Wed, 29 Dec 2004 20:58:21 +0000
parents 410fa1a31baf
children a217baa06d43
comparison
equal deleted inserted replaced
41:f529edb9bab3 42:c75153d791d0
1 *editing.txt* For Vim version 7.0aa. Last change: 2004 Dec 16 1 *editing.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
44 name. Note that commands invoked indirectly (e.g., 44 name. Note that commands invoked indirectly (e.g.,
45 with a function) may still set the alternate file 45 with a function) may still set the alternate file
46 name. {not in Vi} 46 name. {not in Vi}
47 47
48 All file names are remembered in the buffer list. When you enter a file name, 48 All file names are remembered in the buffer list. When you enter a file name,
49 for editing (e.g., with ":e filename") or writing (e.g., with (:w file name"), 49 for editing (e.g., with ":e filename") or writing (e.g., with ":w file name"),
50 the file name is added to the list. You can use the buffer list to remember 50 the file name is added to the list. You can use the buffer list to remember
51 which files you edited and to quickly switch from one file to another (e.g., 51 which files you edited and to quickly switch from one file to another (e.g.,
52 to copy text) with the |CTRL-^| command. First type the number of the file 52 to copy text) with the |CTRL-^| command. First type the number of the file
53 and then hit CTRL-^. {Vi: only one alternate file name is remembered} 53 and then hit CTRL-^. {Vi: only one alternate file name is remembered}
54 54
55 55
56 CTRL-G or *CTRL-G* *:f* *:fi* *:file* 56 CTRL-G or *CTRL-G* *:f* *:fi* *:file*
57 :f[ile] Prints the current file name (as typed), the 57 :f[ile] Prints the current file name (as typed), the
58 cursor position (unless the 'ruler' option is set), 58 cursor position (unless the 'ruler' option is set),
59 and the file status (readonly, modified, read errors, 59 and the file status (readonly, modified, read errors,
60 new file)). See the 'shortmess' option about how tho 60 new file). See the 'shortmess' option about how tho
61 make this message shorter. {Vi does not include 61 make this message shorter. {Vi does not include
62 column number} 62 column number}
63 63
64 :f[ile]! like |:file|, but don't truncate the name even when 64 :f[ile]! like |:file|, but don't truncate the name even when
65 'shortmess' indicates this. 65 'shortmess' indicates this.
109 If the environment variable $HOME is set, and the file name starts with that 109 If the environment variable $HOME is set, and the file name starts with that
110 string, it is often displayed with HOME replaced with "~". This was done to 110 string, it is often displayed with HOME replaced with "~". This was done to
111 keep file names short. When reading or writing files the full name is still 111 keep file names short. When reading or writing files the full name is still
112 used, the "~" is only used when displaying file names. When replacing the 112 used, the "~" is only used when displaying file names. When replacing the
113 file name would result in just "~", "~/" is used instead (to avoid confusion 113 file name would result in just "~", "~/" is used instead (to avoid confusion
114 with 'backupext' set to "~"). 114 between options set to $HOME with 'backupext' set to "~").
115 115
116 When writing the buffer, the default is to use the current file name. Thus 116 When writing the buffer, the default is to use the current file name. Thus
117 when you give the "ZZ" or ":wq" command, the original file will be 117 when you give the "ZZ" or ":wq" command, the original file will be
118 overwritten. If you do not want this, the buffer can be written into another 118 overwritten. If you do not want this, the buffer can be written into another
119 file by giving a file name argument to the ":write" command. For example: > 119 file by giving a file name argument to the ":write" command. For example: >
258 :ex [++opt] [+cmd] [file] 258 :ex [++opt] [+cmd] [file]
259 Same as |:edit|. 259 Same as |:edit|.
260 260
261 *:vi* *:visual* 261 *:vi* *:visual*
262 :vi[sual][!] [++opt] [+cmd] [file] 262 :vi[sual][!] [++opt] [+cmd] [file]
263 When entered in Ex mode: Leave |Ex-mode|, go back to 263 When used in Ex mode: Leave |Ex-mode|, go back to
264 Normal mode. Otherwise same as |:edit|. 264 Normal mode. Otherwise same as |:edit|.
265 265
266 *:vie* *:view* 266 *:vie* *:view*
267 :vie[w] [++opt] [+cmd] file 267 :vie[w] [++opt] [+cmd] file
268 When entered in Ex mode: Leave Ex mode, go back to 268 When used in Ex mode: Leave |Ex mode|, go back to
269 Normal mode. Otherwise same as |:edit|, but set 269 Normal mode. Otherwise same as |:edit|, but set
270 'readonly' option for this buffer. {not in Vi} 270 'readonly' option for this buffer. {not in Vi}
271 271
272 *CTRL-^* *CTRL-6* 272 *CTRL-^* *CTRL-6*
273 CTRL-^ Edit the alternate file (equivalent to ":e #"). 273 CTRL-^ Edit the alternate file (equivalent to ":e #").
664 Write current file to {file} and start editing the 664 Write current file to {file} and start editing the
665 [count] next file. Also see |++opt| and |+cmd|. {not 665 [count] next file. Also see |++opt| and |+cmd|. {not
666 in Vi} 666 in Vi}
667 667
668 :[count]wN[ext][!] [++opt] [+cmd] [file] *:wN* *:wNext* 668 :[count]wN[ext][!] [++opt] [+cmd] [file] *:wN* *:wNext*
669 :[count]wp[revous][!] [++opt] [+cmd] [file] *:wp* *:wprevious* 669 :[count]wp[revious][!] [++opt] [+cmd] [file] *:wp* *:wprevious*
670 Same as :wnext, but go to previous file instead of 670 Same as :wnext, but go to previous file instead of
671 next. {not in Vi} 671 next. {not in Vi}
672 672
673 The [count] in the commands above defaults to one. For some commands it is 673 The [count] in the commands above defaults to one. For some commands it is
674 possible to use two counts. The last one (rightmost one) is used. 674 possible to use two counts. The last one (rightmost one) is used.
1400 1400
1401 The usage of '*' is quite simple: It matches 0 or more characters. 1401 The usage of '*' is quite simple: It matches 0 or more characters.
1402 1402
1403 '**' is more sophisticated: 1403 '**' is more sophisticated:
1404 - It ONLY matches directories. 1404 - It ONLY matches directories.
1405 - It matches up to 30 directories deep, so you can use it to search an 1405 - It matches up to 30 directories deep, so you can use it to search an
1406 entire directory tree 1406 entire directory tree
1407 - The maximum number of levels matched can be given by appending a number 1407 - The maximum number of levels matched can be given by appending a number
1408 to '**'. 1408 to '**'.
1409 Thus '/usr/**2' can match: > 1409 Thus '/usr/**2' can match: >
1410 /usr 1410 /usr