Christian Brabandt | 1514120 | 2024-08-03 15:40:19 +0200 | [diff] [blame] | 1 | .TH VIM 1 "2024 Aug 03" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2 | .SH NAME |
Bram Moolenaar | 1ccd8ff | 2017-08-11 19:50:37 +0200 | [diff] [blame] | 3 | vim \- Vi IMproved, a programmer's text editor |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4 | .SH SYNOPSIS |
| 5 | .br |
| 6 | .B vim |
| 7 | [options] [file ..] |
| 8 | .br |
| 9 | .B vim |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 10 | [options] \- |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 11 | .br |
| 12 | .B vim |
| 13 | [options] \-t tag |
| 14 | .br |
| 15 | .B vim |
| 16 | [options] \-q [errorfile] |
| 17 | .PP |
| 18 | .br |
| 19 | .B ex |
| 20 | .br |
| 21 | .B view |
| 22 | .br |
| 23 | .B gvim |
| 24 | .B gview |
| 25 | .B evim |
| 26 | .B eview |
| 27 | .br |
| 28 | .B rvim |
| 29 | .B rview |
| 30 | .B rgvim |
| 31 | .B rgview |
| 32 | .SH DESCRIPTION |
| 33 | .B Vim |
| 34 | is a text editor that is upwards compatible to Vi. |
| 35 | It can be used to edit all kinds of plain text. |
| 36 | It is especially useful for editing programs. |
| 37 | .PP |
| 38 | There are a lot of enhancements above Vi: multi level undo, |
| 39 | multi windows and buffers, syntax highlighting, command line |
| 40 | editing, filename completion, on-line help, visual selection, etc.. |
| 41 | See ":help vi_diff.txt" for a summary of the differences between |
| 42 | .B Vim |
| 43 | and Vi. |
| 44 | .PP |
| 45 | While running |
| 46 | .B Vim |
| 47 | a lot of help can be obtained from the on-line help system, with the ":help" |
| 48 | command. |
| 49 | See the ON-LINE HELP section below. |
| 50 | .PP |
| 51 | Most often |
| 52 | .B Vim |
| 53 | is started to edit a single file with the command |
| 54 | .PP |
| 55 | vim file |
| 56 | .PP |
| 57 | More generally |
| 58 | .B Vim |
| 59 | is started with: |
| 60 | .PP |
| 61 | vim [options] [filelist] |
| 62 | .PP |
| 63 | If the filelist is missing, the editor will start with an empty buffer. |
| 64 | Otherwise exactly one out of the following four may be used to choose one or |
| 65 | more files to be edited. |
| 66 | .TP 12 |
| 67 | file .. |
| 68 | A list of filenames. |
| 69 | The first one will be the current file and read into the buffer. |
| 70 | The cursor will be positioned on the first line of the buffer. |
| 71 | You can get to the other files with the ":next" command. |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 72 | To edit a file that starts with a dash, precede the filelist with "\-\-". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 73 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 74 | \- |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 75 | The file to edit is read from stdin. Commands are read from stderr, which |
| 76 | should be a tty. |
| 77 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 78 | \-t {tag} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 79 | The file to edit and the initial cursor position depends on a "tag", a sort |
| 80 | of goto label. |
| 81 | {tag} is looked up in the tags file, the associated file becomes the current |
| 82 | file and the associated command is executed. |
| 83 | Mostly this is used for C programs, in which case {tag} could be a function |
| 84 | name. |
| 85 | The effect is that the file containing that function becomes the current file |
| 86 | and the cursor is positioned on the start of the function. |
Bram Moolenaar | 3991dab | 2006-03-27 17:01:56 +0000 | [diff] [blame] | 87 | See ":help tag\-commands". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 88 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 89 | \-q [errorfile] |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 90 | Start in quickFix mode. |
| 91 | The file [errorfile] is read and the first error is displayed. |
| 92 | If [errorfile] is omitted, the filename is obtained from the 'errorfile' |
| 93 | option (defaults to "AztecC.Err" for the Amiga, "errors.err" on other |
| 94 | systems). |
| 95 | Further errors can be jumped to with the ":cn" command. |
| 96 | See ":help quickfix". |
| 97 | .PP |
| 98 | .B Vim |
| 99 | behaves differently, depending on the name of the command (the executable may |
| 100 | still be the same file). |
| 101 | .TP 10 |
| 102 | vim |
| 103 | The "normal" way, everything is default. |
| 104 | .TP |
| 105 | ex |
| 106 | Start in Ex mode. |
| 107 | Go to Normal mode with the ":vi" command. |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 108 | Can also be done with the "\-e" argument. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 109 | .TP |
| 110 | view |
Bram Moolenaar | fd35811 | 2018-07-07 23:21:31 +0200 | [diff] [blame] | 111 | Start in read-only mode. You will be protected from writing the files. |
| 112 | Can also be done with the "\-R" argument. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 113 | .TP |
| 114 | gvim gview |
| 115 | The GUI version. |
| 116 | Starts a new window. |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 117 | Can also be done with the "\-g" argument. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 118 | .TP |
| 119 | evim eview |
| 120 | The GUI version in easy mode. |
| 121 | Starts a new window. |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 122 | Can also be done with the "\-y" argument. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 123 | .TP |
| 124 | rvim rview rgvim rgview |
| 125 | Like the above, but with restrictions. It will not be possible to start shell |
| 126 | commands, or suspend |
| 127 | .B Vim. |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 128 | Can also be done with the "\-Z" argument. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 129 | .SH OPTIONS |
| 130 | The options may be given in any order, before or after filenames. |
| 131 | Options without an argument can be combined after a single dash. |
| 132 | .TP 12 |
| 133 | +[num] |
| 134 | For the first file the cursor will be positioned on line "num". |
| 135 | If "num" is missing, the cursor will be positioned on the last line. |
| 136 | .TP |
| 137 | +/{pat} |
Bram Moolenaar | 8a94d87 | 2015-01-25 13:02:57 +0100 | [diff] [blame] | 138 | For the first file the cursor will be positioned in the line with the |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 139 | first occurrence of {pat}. |
Bram Moolenaar | 3991dab | 2006-03-27 17:01:56 +0000 | [diff] [blame] | 140 | See ":help search\-pattern" for the available search patterns. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 141 | .TP |
| 142 | +{command} |
| 143 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 144 | \-c {command} |
Bram Moolenaar | fd35811 | 2018-07-07 23:21:31 +0200 | [diff] [blame] | 145 | {command} will be executed after the first file has been read. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 146 | {command} is interpreted as an Ex command. |
| 147 | If the {command} contains spaces it must be enclosed in double quotes (this |
| 148 | depends on the shell that is used). |
Bram Moolenaar | 2547aa9 | 2020-07-26 17:00:44 +0200 | [diff] [blame] | 149 | Example: vim "+set si" main.c |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 150 | .br |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 151 | Note: You can use up to 10 "+" or "\-c" commands. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 152 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 153 | \-S {file} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 154 | {file} will be sourced after the first file has been read. |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 155 | This is equivalent to \-c "source {file}". |
| 156 | {file} cannot start with '\-'. |
| 157 | If {file} is omitted "Session.vim" is used (only works when \-S is the last |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 158 | argument). |
| 159 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 160 | \-\-cmd {command} |
| 161 | Like using "\-c", but the command is executed just before |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 162 | processing any vimrc file. |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 163 | You can use up to 10 of these commands, independently from "\-c" commands. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 164 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 165 | \-A |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 166 | If |
| 167 | .B Vim |
| 168 | has been compiled with ARABIC support for editing right-to-left |
| 169 | oriented files and Arabic keyboard mapping, this option starts |
| 170 | .B Vim |
| 171 | in Arabic mode, i.e. 'arabic' is set. Otherwise an error |
| 172 | message is given and |
| 173 | .B Vim |
| 174 | aborts. |
| 175 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 176 | \-b |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 177 | Binary mode. |
| 178 | A few options will be set that makes it possible to edit a binary or |
| 179 | executable file. |
| 180 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 181 | \-C |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 182 | Compatible. Set the 'compatible' option. |
| 183 | This will make |
| 184 | .B Vim |
| 185 | behave mostly like Vi, even though a .vimrc file exists. |
| 186 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 187 | \-d |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 188 | Start in diff mode. |
Bram Moolenaar | 2346a63 | 2021-06-13 19:02:49 +0200 | [diff] [blame] | 189 | There should between two to eight file name arguments. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 190 | .B Vim |
| 191 | will open all the files and show differences between them. |
| 192 | Works like vimdiff(1). |
| 193 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 194 | \-d {device}, \-dev {device} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 195 | Open {device} for use as a terminal. |
| 196 | Only on the Amiga. |
| 197 | Example: |
| 198 | "\-d con:20/30/600/150". |
| 199 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 200 | \-D |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 201 | Debugging. Go to debugging mode when executing the first command from a |
| 202 | script. |
| 203 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 204 | \-e |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 205 | Start |
| 206 | .B Vim |
| 207 | in Ex mode, just like the executable was called "ex". |
| 208 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 209 | \-E |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 210 | Start |
| 211 | .B Vim |
| 212 | in improved Ex mode, just like the executable was called "exim". |
| 213 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 214 | \-f |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 215 | Foreground. For the GUI version, |
| 216 | .B Vim |
| 217 | will not fork and detach from the shell it was started in. |
| 218 | On the Amiga, |
| 219 | .B Vim |
| 220 | is not restarted to open a new window. |
| 221 | This option should be used when |
| 222 | .B Vim |
| 223 | is executed by a program that will wait for the edit |
| 224 | session to finish (e.g. mail). |
| 225 | On the Amiga the ":sh" and ":!" commands will not work. |
| 226 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 227 | \-\-nofork |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 228 | Foreground. For the GUI version, |
| 229 | .B Vim |
| 230 | will not fork and detach from the shell it was started in. |
| 231 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 232 | \-F |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 233 | If |
| 234 | .B Vim |
| 235 | has been compiled with FKMAP support for editing right-to-left |
| 236 | oriented files and Farsi keyboard mapping, this option starts |
| 237 | .B Vim |
| 238 | in Farsi mode, i.e. 'fkmap' and 'rightleft' are set. |
| 239 | Otherwise an error message is given and |
| 240 | .B Vim |
| 241 | aborts. |
| 242 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 243 | \-g |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 244 | If |
| 245 | .B Vim |
| 246 | has been compiled with GUI support, this option enables the GUI. |
| 247 | If no GUI support was compiled in, an error message is given and |
| 248 | .B Vim |
| 249 | aborts. |
| 250 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 251 | \-\-gui-dialog-file {name} |
| 252 | When using the GUI, instead of showing a dialog, write the title and message of |
| 253 | the dialog to file {name}. The file is created or appended to. Only useful |
| 254 | for testing, to avoid that the test gets stuck on a dialog that can't be seen. |
| 255 | Without the GUI the argument is ignored. |
| 256 | .TP |
| 257 | \-\-help, \-h, \-? |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 258 | Give a bit of help about the command line arguments and options. |
| 259 | After this |
| 260 | .B Vim |
| 261 | exits. |
| 262 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 263 | \-H |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 264 | If |
| 265 | .B Vim |
| 266 | has been compiled with RIGHTLEFT support for editing right-to-left |
| 267 | oriented files and Hebrew keyboard mapping, this option starts |
| 268 | .B Vim |
| 269 | in Hebrew mode, i.e. 'hkmap' and 'rightleft' are set. |
| 270 | Otherwise an error message is given and |
| 271 | .B Vim |
| 272 | aborts. |
| 273 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 274 | \-i {viminfo} |
Bram Moolenaar | 56c860c | 2019-08-17 20:09:31 +0200 | [diff] [blame] | 275 | Specifies the filename to use when reading or writing the viminfo file, |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 276 | instead of the default "~/.viminfo". |
| 277 | This can also be used to skip the use of the .viminfo file, by giving the name |
| 278 | "NONE". |
| 279 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 280 | \-L |
| 281 | Same as \-r. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 282 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 283 | \-l |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 284 | Lisp mode. |
| 285 | Sets the 'lisp' and 'showmatch' options on. |
| 286 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 287 | \-m |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 288 | Modifying files is disabled. |
| 289 | Resets the 'write' option. |
| 290 | You can still modify the buffer, but writing a file is not possible. |
| 291 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 292 | \-M |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 293 | Modifications not allowed. The 'modifiable' and 'write' options will be unset, |
| 294 | so that changes are not allowed and files can not be written. Note that these |
| 295 | options can be set to enable making modifications. |
| 296 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 297 | \-N |
Bram Moolenaar | 56c860c | 2019-08-17 20:09:31 +0200 | [diff] [blame] | 298 | No-compatible mode. Resets the 'compatible' option. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 299 | This will make |
| 300 | .B Vim |
| 301 | behave a bit better, but less Vi compatible, even though a .vimrc file does |
| 302 | not exist. |
| 303 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 304 | \-n |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 305 | No swap file will be used. |
| 306 | Recovery after a crash will be impossible. |
| 307 | Handy if you want to edit a file on a very slow medium (e.g. floppy). |
| 308 | Can also be done with ":set uc=0". |
| 309 | Can be undone with ":set uc=200". |
| 310 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 311 | \-nb |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 312 | Become an editor server for NetBeans. See the docs for details. |
| 313 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 314 | \-o[N] |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 315 | Open N windows stacked. |
| 316 | When N is omitted, open one window for each file. |
| 317 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 318 | \-O[N] |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 319 | Open N windows side by side. |
| 320 | When N is omitted, open one window for each file. |
| 321 | .TP |
Bram Moolenaar | c17ef8e | 2006-03-25 21:48:58 +0000 | [diff] [blame] | 322 | \-p[N] |
| 323 | Open N tab pages. |
| 324 | When N is omitted, open one tab page for each file. |
| 325 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 326 | \-P {parent-title} |
| 327 | Win32 GUI only: Specify the title of the parent application. When possible, Vim |
| 328 | will run in an MDI window inside the application. {parent-title} must appear in |
| 329 | the window title of the parent application. Make sure that it is specific |
| 330 | enough. Note that the implementation is still primitive. It won't work with |
| 331 | all applications and the menu doesn't work. |
| 332 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 333 | \-R |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 334 | Read-only mode. |
| 335 | The 'readonly' option will be set. |
Bram Moolenaar | 03413f4 | 2016-04-12 21:07:15 +0200 | [diff] [blame] | 336 | You can still edit the buffer, but will be prevented from accidentally |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 337 | overwriting a file. |
| 338 | If you do want to overwrite a file, add an exclamation mark to the Ex command, |
| 339 | as in ":w!". |
Bram Moolenaar | 24a98a0 | 2017-09-27 22:23:55 +0200 | [diff] [blame] | 340 | The \-R option also implies the \-n option (see above). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 341 | The 'readonly' option can be reset with ":set noro". |
| 342 | See ":help 'readonly'". |
| 343 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 344 | \-r |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 345 | List swap files, with information about using them for recovery. |
| 346 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 347 | \-r {file} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 348 | Recovery mode. |
| 349 | The swap file is used to recover a crashed editing session. |
| 350 | The swap file is a file with the same filename as the text file with ".swp" |
| 351 | appended. |
| 352 | See ":help recovery". |
| 353 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 354 | \-s |
| 355 | Silent mode. Only when started as "Ex" or when the "\-e" option was given |
| 356 | before the "\-s" option. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 357 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 358 | \-s {scriptin} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 359 | The script file {scriptin} is read. |
| 360 | The characters in the file are interpreted as if you had typed them. |
| 361 | The same can be done with the command ":source! {scriptin}". |
| 362 | If the end of the file is reached before the editor exits, further characters |
| 363 | are read from the keyboard. |
| 364 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 365 | \-T {terminal} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 366 | Tells |
| 367 | .B Vim |
| 368 | the name of the terminal you are using. |
| 369 | Only required when the automatic way doesn't work. |
Bram Moolenaar | fd35811 | 2018-07-07 23:21:31 +0200 | [diff] [blame] | 370 | Should be a terminal known to |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 371 | .B Vim |
| 372 | (builtin) or defined in the termcap or terminfo file. |
| 373 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 374 | \-\-not-a-term |
| 375 | Tells |
| 376 | .B Vim |
| 377 | that the user knows that the input and/or output is not connected to a |
| 378 | terminal. This will avoid the warning and the two second delay that would |
| 379 | happen. |
| 380 | .TP |
| 381 | \-\-ttyfail |
| 382 | When stdin or stdout is not a a terminal (tty) then exit right away. |
| 383 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 384 | \-u {vimrc} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 385 | Use the commands in the file {vimrc} for initializations. |
| 386 | All the other initializations are skipped. |
| 387 | Use this to edit a special kind of files. |
| 388 | It can also be used to skip all initializations by giving the name "NONE". |
| 389 | See ":help initialization" within vim for more details. |
| 390 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 391 | \-U {gvimrc} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 392 | Use the commands in the file {gvimrc} for GUI initializations. |
| 393 | All the other GUI initializations are skipped. |
| 394 | It can also be used to skip all GUI initializations by giving the name "NONE". |
Bram Moolenaar | 3991dab | 2006-03-27 17:01:56 +0000 | [diff] [blame] | 395 | See ":help gui\-init" within vim for more details. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 396 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 397 | \-V[N] |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 398 | Verbose. Give messages about which files are sourced and for reading and |
| 399 | writing a viminfo file. The optional number N is the value for 'verbose'. |
| 400 | Default is 10. |
| 401 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 402 | \-V[N]{filename} |
| 403 | Like \-V and set 'verbosefile' to {filename}. The result is that messages are |
| 404 | not displayed but written to the file {filename}. {filename} must not start |
| 405 | with a digit. |
| 406 | .TP |
| 407 | \-\-log {filename} |
| 408 | If |
| 409 | .B Vim |
| 410 | has been compiled with eval and channel feature, start logging and write |
| 411 | entries to {filename}. This works like calling |
| 412 | .I ch_logfile({filename}, 'ao') |
| 413 | very early during startup. |
| 414 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 415 | \-v |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 416 | Start |
| 417 | .B Vim |
| 418 | in Vi mode, just like the executable was called "vi". This only has effect |
| 419 | when the executable is called "ex". |
| 420 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 421 | \-w{number} |
| 422 | Set the 'window' option to {number}. |
| 423 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 424 | \-w {scriptout} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 425 | All the characters that you type are recorded in the file |
| 426 | {scriptout}, until you exit |
| 427 | .B Vim. |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 428 | This is useful if you want to create a script file to be used with "vim \-s" or |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 429 | ":source!". |
| 430 | If the {scriptout} file exists, characters are appended. |
| 431 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 432 | \-W {scriptout} |
| 433 | Like \-w, but an existing file is overwritten. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 434 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 435 | \-x |
Christian Brabandt | 1514120 | 2024-08-03 15:40:19 +0200 | [diff] [blame] | 436 | If |
| 437 | .B Vim |
| 438 | has been compiled with encryption support, use encryption when writing files. |
| 439 | Will prompt for a crypt key. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 440 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 441 | \-X |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 442 | Don't connect to the X server. Shortens startup time in a terminal, but the |
| 443 | window title and clipboard will not be used. |
| 444 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 445 | \-y |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 446 | Start |
| 447 | .B Vim |
| 448 | in easy mode, just like the executable was called "evim" or "eview". |
| 449 | Makes |
| 450 | .B Vim |
| 451 | behave like a click-and-type editor. |
| 452 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 453 | \-Z |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 454 | Restricted mode. Works like the executable starts with "r". |
| 455 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 456 | \-\- |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 457 | Denotes the end of the options. |
| 458 | Arguments after this will be handled as a file name. |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 459 | This can be used to edit a filename that starts with a '\-'. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 460 | .TP |
Bram Moolenaar | 56994d2 | 2021-04-17 16:31:09 +0200 | [diff] [blame] | 461 | \-\-clean |
| 462 | Do not use any personal configuration (vimrc, plugins, etc.). Useful to see if |
| 463 | a problem reproduces with a clean Vim setup. |
| 464 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 465 | \-\-echo\-wid |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 466 | GTK GUI only: Echo the Window ID on stdout. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 467 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 468 | \-\-literal |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 469 | Take file name arguments literally, do not expand wildcards. This has no |
| 470 | effect on Unix where the shell expands wildcards. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 471 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 472 | \-\-noplugin |
| 473 | Skip loading plugins. Implied by \-u NONE. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 474 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 475 | \-\-remote |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 476 | Connect to a Vim server and make it edit the files given in the rest of the |
| 477 | arguments. If no server is found a warning is given and the files are edited |
| 478 | in the current Vim. |
| 479 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 480 | \-\-remote\-expr {expr} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 481 | Connect to a Vim server, evaluate {expr} in it and print the result on stdout. |
| 482 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 483 | \-\-remote\-send {keys} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 484 | Connect to a Vim server and send {keys} to it. |
| 485 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 486 | \-\-remote\-silent |
| 487 | As \-\-remote, but without the warning when no server is found. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 488 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 489 | \-\-remote\-wait |
| 490 | As \-\-remote, but Vim does not exit until the files have been edited. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 491 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 492 | \-\-remote\-wait\-silent |
| 493 | As \-\-remote\-wait, but without the warning when no server is found. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 494 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 495 | \-\-serverlist |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 496 | List the names of all Vim servers that can be found. |
| 497 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 498 | \-\-servername {name} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 499 | Use {name} as the server name. Used for the current Vim, unless used with a |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 500 | \-\-remote argument, then it's the name of the server to connect to. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 501 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 502 | \-\-socketid {id} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 503 | GTK GUI only: Use the GtkPlug mechanism to run gvim in another window. |
| 504 | .TP |
Bram Moolenaar | 3132cdd | 2020-11-05 20:41:49 +0100 | [diff] [blame] | 505 | \-\-startuptime {file} |
| 506 | During startup write timing messages to the file {fname}. |
| 507 | .TP |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 508 | \-\-version |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 509 | Print version information and exit. |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 510 | .TP |
| 511 | \-\-windowid {id} |
| 512 | Win32 GUI only: Make gvim try to use the window {id} as a parent, so that it |
| 513 | runs inside that window. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 514 | .SH ON-LINE HELP |
| 515 | Type ":help" in |
| 516 | .B Vim |
| 517 | to get started. |
| 518 | Type ":help subject" to get help on a specific subject. |
| 519 | For example: ":help ZZ" to get help for the "ZZ" command. |
Bram Moolenaar | 3991dab | 2006-03-27 17:01:56 +0000 | [diff] [blame] | 520 | Use <Tab> and CTRL-D to complete subjects (":help cmdline\-completion"). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 521 | Tags are present to jump from one place to another (sort of hypertext links, |
| 522 | see ":help"). |
| 523 | All documentation files can be viewed in this way, for example |
| 524 | ":help syntax.txt". |
| 525 | .SH FILES |
| 526 | .TP 15 |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 527 | /usr/local/share/vim/vim??/doc/*.txt |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 528 | The |
| 529 | .B Vim |
| 530 | documentation files. |
Bram Moolenaar | 4317d9b | 2005-03-18 20:25:31 +0000 | [diff] [blame] | 531 | Use ":help doc\-file\-list" to get the complete list. |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 532 | .br |
| 533 | .I vim?? |
| 534 | is short version number, like vim91 for |
| 535 | .B Vim 9.1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 536 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 537 | /usr/local/share/vim/vim??/doc/tags |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 538 | The tags file used for finding information in the documentation files. |
| 539 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 540 | /usr/local/share/vim/vim??/syntax/syntax.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 541 | System wide syntax initializations. |
| 542 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 543 | /usr/local/share/vim/vim??/syntax/*.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 544 | Syntax files for various languages. |
| 545 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 546 | /usr/local/share/vim/vimrc |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 547 | System wide |
| 548 | .B Vim |
| 549 | initializations. |
| 550 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 551 | ~/.vimrc, ~/.vim/vimrc, $XDG_CONFIG_HOME/vim/vimrc |
Bram Moolenaar | 05159a0 | 2005-02-26 23:04:13 +0000 | [diff] [blame] | 552 | Your personal |
| 553 | .B Vim |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 554 | initializations (first one found is used). |
Bram Moolenaar | 05159a0 | 2005-02-26 23:04:13 +0000 | [diff] [blame] | 555 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 556 | /usr/local/share/vim/gvimrc |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 557 | System wide gvim initializations. |
| 558 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 559 | ~/.gvimrc, ~/.vim/gvimrc, $XDG_CONFIG_HOME/vim/gvimrc |
| 560 | Your personal gvim initializations (first one found is used). |
Bram Moolenaar | 05159a0 | 2005-02-26 23:04:13 +0000 | [diff] [blame] | 561 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 562 | /usr/local/share/vim/vim??/optwin.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 563 | Script used for the ":options" command, a nice way to view and set options. |
| 564 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 565 | /usr/local/share/vim/vim??/menu.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 566 | System wide menu initializations for gvim. |
| 567 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 568 | /usr/local/share/vim/vim??/bugreport.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 569 | Script to generate a bug report. See ":help bugs". |
| 570 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 571 | /usr/local/share/vim/vim??/filetype.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 572 | Script to detect the type of a file by its name. See ":help 'filetype'". |
| 573 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 574 | /usr/local/share/vim/vim??/scripts.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 575 | Script to detect the type of a file by its contents. See ":help 'filetype'". |
| 576 | .TP |
Christian Brabandt | ce6fe84 | 2024-06-04 21:58:32 +0200 | [diff] [blame] | 577 | /usr/local/share/vim/vim??/print/*.ps |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 578 | Files used for PostScript printing. |
| 579 | .PP |
| 580 | For recent info read the VIM home page: |
| 581 | .br |
| 582 | <URL:http://www.vim.org/> |
| 583 | .SH SEE ALSO |
| 584 | vimtutor(1) |
| 585 | .SH AUTHOR |
| 586 | Most of |
| 587 | .B Vim |
| 588 | was made by Bram Moolenaar, with a lot of help from others. |
| 589 | See ":help credits" in |
| 590 | .B Vim. |
| 591 | .br |
| 592 | .B Vim |
| 593 | is based on Stevie, worked on by: Tim Thompson, |
| 594 | Tony Andrews and G.R. (Fred) Walter. |
| 595 | Although hardly any of the original code remains. |
| 596 | .SH BUGS |
| 597 | Probably. |
| 598 | See ":help todo" for a list of known problems. |
| 599 | .PP |
| 600 | Note that a number of things that may be regarded as bugs by some, are in fact |
| 601 | caused by a too-faithful reproduction of Vi's behaviour. |
| 602 | And if you think other things are bugs "because Vi does it differently", |
| 603 | you should take a closer look at the vi_diff.txt file (or type :help |
| 604 | vi_diff.txt when in Vim). |
| 605 | Also have a look at the 'compatible' and 'cpoptions' options. |