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