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