1*e0e39175SBram Moolenaar*vi_diff.txt* For Vim version 8.2. Last change: 2021 Jan 21 2071d4279SBram Moolenaar 3071d4279SBram Moolenaar 4071d4279SBram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar 5071d4279SBram Moolenaar 6071d4279SBram Moolenaar 7071d4279SBram MoolenaarDifferences between Vim and Vi *vi-differences* 8071d4279SBram Moolenaar 925c9c680SBram MoolenaarThis file lists the differences between Vim and Vi/Ex and gives an overview of 1025c9c680SBram Moolenaarwhat is in Vim that is not in Vi. 11071d4279SBram Moolenaar 12071d4279SBram MoolenaarVim is mostly POSIX 1003.2-1 compliant. The only command known to be missing 13071d4279SBram Moolenaaris ":open". There are probably a lot of small differences (either because Vim 14071d4279SBram Moolenaaris missing something or because Posix is beside the mark). 15071d4279SBram Moolenaar 166bdcfc08SBram Moolenaar1. Simulated command |simulated-command| 17071d4279SBram Moolenaar2. Missing options |missing-options| 18071d4279SBram Moolenaar3. Limits |limits| 19071d4279SBram Moolenaar4. The most interesting additions |vim-additions| 20071d4279SBram Moolenaar5. Other vim features |other-features| 216c60f47fSBram Moolenaar6. Supported Vi features |vi-features| 226c60f47fSBram Moolenaar7. Command-line arguments |cmdline-arguments| 236c60f47fSBram Moolenaar8. POSIX compliance |posix-compliance| 24071d4279SBram Moolenaar 25071d4279SBram Moolenaar============================================================================== 266bdcfc08SBram Moolenaar1. Simulated command *simulated-command* 27071d4279SBram Moolenaar 28dd2a3cdaSBram MoolenaarThis command is in Vi, but Vim only simulates it: 29071d4279SBram Moolenaar 306bdcfc08SBram Moolenaar *:o* *:op* *:open* 316bdcfc08SBram Moolenaar:[range]o[pen] Works like |:visual|: end Ex mode. 326bdcfc08SBram Moolenaar {Vi: start editing in open mode} 336bdcfc08SBram Moolenaar 346bdcfc08SBram Moolenaar:[range]o[pen] /pattern/ As above, additionally move the cursor to the 356bdcfc08SBram Moolenaar column where "pattern" matches in the cursor 366bdcfc08SBram Moolenaar line. 376bdcfc08SBram Moolenaar 386bdcfc08SBram MoolenaarVim does not support open mode, since it's not really useful. For those 396bdcfc08SBram Moolenaarsituations where ":open" would start open mode Vim will leave Ex mode, which 406bdcfc08SBram Moolenaarallows executing the same commands, but updates the whole screen instead of 416bdcfc08SBram Moolenaaronly one line. 42071d4279SBram Moolenaar 43071d4279SBram Moolenaar============================================================================== 44071d4279SBram Moolenaar2. Missing options *missing-options* 45071d4279SBram Moolenaar 46071d4279SBram MoolenaarThese options are in the Unix Vi, but not in Vim. If you try to set one of 47071d4279SBram Moolenaarthem you won't get an error message, but the value is not used and cannot be 48071d4279SBram Moolenaarprinted. 49071d4279SBram Moolenaar 50071d4279SBram Moolenaarautoprint (ap) boolean (default on) *'autoprint'* *'ap'* 51071d4279SBram Moolenaarbeautify (bf) boolean (default off) *'beautify'* *'bf'* 52071d4279SBram Moolenaarflash (fl) boolean (default ??) *'flash'* *'fl'* 53071d4279SBram Moolenaargraphic (gr) boolean (default off) *'graphic'* *'gr'* 54071d4279SBram Moolenaarhardtabs (ht) number (default 8) *'hardtabs'* *'ht'* 55071d4279SBram Moolenaar number of spaces that a <Tab> moves on the display 56071d4279SBram Moolenaarmesg boolean (default on) *'mesg'* 57071d4279SBram Moolenaarnovice boolean (default off) *'novice'* 58071d4279SBram Moolenaaropen boolean (default on) *'open'* 59071d4279SBram Moolenaaroptimize (op) boolean (default off) *'optimize'* *'op'* 60071d4279SBram Moolenaarredraw boolean (default off) *'redraw'* 61071d4279SBram Moolenaarslowopen (slow) boolean (default off) *'slowopen'* *'slow'* 62071d4279SBram Moolenaarsourceany boolean (default off) *'sourceany'* 63071d4279SBram Moolenaarw300 number (default 23) *'w300'* 64071d4279SBram Moolenaarw1200 number (default 23) *'w1200'* 65071d4279SBram Moolenaarw9600 number (default 23) *'w9600'* 66071d4279SBram Moolenaar 672e693a88SBram MoolenaarVi did not allow for changing the termcap entries, you would have to exit Vi, 682e693a88SBram Moolenaaredit the termcap entry and try again. Vim has the |terminal-options|. 692e693a88SBram Moolenaar 70071d4279SBram Moolenaar============================================================================== 71071d4279SBram Moolenaar3. Limits *limits* 72071d4279SBram Moolenaar 73071d4279SBram MoolenaarVim has only a few limits for the files that can be edited {Vi: can not handle 74071d4279SBram Moolenaar<Nul> characters and characters above 128, has limited line length, many other 75071d4279SBram Moolenaarlimits}. 7698a29d00SBram Moolenaar 775666fcd0SBram MoolenaarMaximum line length 2147483647 characters. Longer lines are split. 78071d4279SBram MoolenaarMaximum number of lines 2147483647 lines. 79071d4279SBram MoolenaarMaximum file size 2147483647 bytes (2 Gbyte) when a long integer is 80071d4279SBram Moolenaar 32 bits. Much more for 64 bit longs. Also limited 81071d4279SBram Moolenaar by available disk space for the |swap-file|. 82071d4279SBram Moolenaar *E75* 83071d4279SBram MoolenaarLength of a file path Unix and Win32: 1024 characters, otherwise 256 84071d4279SBram Moolenaar characters (or as much as the system supports). 85071d4279SBram MoolenaarLength of an expanded string option 86071d4279SBram Moolenaar Unix and Win32: 1024 characters, otherwise 256 87071d4279SBram Moolenaar characters 88071d4279SBram MoolenaarMaximum display width Unix and Win32: 1024 characters, otherwise 255 89071d4279SBram Moolenaar characters 90071d4279SBram MoolenaarMaximum lhs of a mapping 50 characters. 914770d09aSBram MoolenaarNumber of different highlighting types: over 30000 925302d9ebSBram MoolenaarRange of a Number variable: -2147483648 to 2147483647 (might be more on 64 935302d9ebSBram Moolenaar bit systems) 944a74803eSBram MoolenaarMaximum length of a line in a tags file: 512 bytes. 95071d4279SBram Moolenaar 96071d4279SBram MoolenaarInformation for undo and text in registers is kept in memory, thus when making 97071d4279SBram Moolenaar(big) changes the amount of (virtual) memory available limits the number of 98071d4279SBram Moolenaarundo levels and the text that can be kept in registers. Other things are also 99071d4279SBram Moolenaarkept in memory: Command-line history, error messages for Quickfix mode, etc. 100071d4279SBram Moolenaar 101071d4279SBram MoolenaarMemory usage limits 102071d4279SBram Moolenaar------------------- 103071d4279SBram Moolenaar 104071d4279SBram MoolenaarThe option 'maxmem' ('mm') is used to set the maximum memory used for one 105071d4279SBram Moolenaarbuffer (in kilobytes). 'maxmemtot' is used to set the maximum memory used for 106071d4279SBram Moolenaarall buffers (in kilobytes). The defaults depend on the system used. For the 1075666fcd0SBram MoolenaarAmiga, 'maxmemtot' is set depending on the amount of memory available. 10818144c84SBram MoolenaarThese are not hard limits, but tell Vim when to move text into a swap file. 10918144c84SBram MoolenaarIf you don't like Vim to swap to a file, set 'maxmem' and 'maxmemtot' to a 11018144c84SBram Moolenaarvery large value. The swap file will then only be used for recovery. If you 11118144c84SBram Moolenaardon't want a swap file at all, set 'updatecount' to 0, or use the "-n" 11218144c84SBram Moolenaarargument when starting Vim. 113071d4279SBram Moolenaar 114071d4279SBram Moolenaar============================================================================== 115071d4279SBram Moolenaar4. The most interesting additions *vim-additions* 116071d4279SBram Moolenaar 117071d4279SBram MoolenaarVi compatibility. |'compatible'| 118071d4279SBram Moolenaar Although Vim is 99% Vi compatible, some things in Vi can be 119071d4279SBram Moolenaar considered to be a bug, or at least need improvement. But still, Vim 120071d4279SBram Moolenaar starts in a mode which behaves like the "real" Vi as much as possible. 121071d4279SBram Moolenaar To make Vim behave a little bit better, try resetting the 'compatible' 122071d4279SBram Moolenaar option: 123071d4279SBram Moolenaar :set nocompatible 124071d4279SBram Moolenaar Or start Vim with the "-N" argument: 125071d4279SBram Moolenaar vim -N 12618144c84SBram Moolenaar Vim starts with 'nocompatible' automatically if you have a .vimrc 12718144c84SBram Moolenaar file. See |startup|. 128071d4279SBram Moolenaar The 'cpoptions' option can be used to set Vi compatibility on/off for 129071d4279SBram Moolenaar a number of specific items. 130071d4279SBram Moolenaar 131071d4279SBram MoolenaarSupport for different systems. 132071d4279SBram Moolenaar Vim can be used on: 133071d4279SBram Moolenaar - All Unix systems (it works on all systems it was tested on, although 134071d4279SBram Moolenaar the GUI and Perl interface may not work everywhere). 135071d4279SBram Moolenaar - Amiga (500, 1000, 1200, 2000, 3000, 4000, ...). 1368024f936SBram Moolenaar - MS-Windows 137071d4279SBram Moolenaar - VMS 138071d4279SBram Moolenaar - Macintosh 139071d4279SBram Moolenaar - IBM OS/390 14018144c84SBram Moolenaar Note that on some systems features need to be disabled to reduce 1415666fcd0SBram Moolenaar resource usage. For some outdated systems you need to use an older 1425666fcd0SBram Moolenaar Vim version. 143071d4279SBram Moolenaar 144dc1f1645SBram MoolenaarMulti level persistent undo. |undo| 145071d4279SBram Moolenaar 'u' goes backward in time, 'CTRL-R' goes forward again. Set option 146071d4279SBram Moolenaar 'undolevels' to the number of changes to be remembered (default 1000). 1477cba6c06SBram Moolenaar Set 'undolevels' to 0 for a Vi-compatible one level undo. Set it to 148071d4279SBram Moolenaar -1 for no undo at all. 149071d4279SBram Moolenaar When all changes in a buffer have been undone, the buffer is not 150071d4279SBram Moolenaar considered changed anymore. You can exit it with :q, without <!>. 15118144c84SBram Moolenaar When undoing a few changes and then making a new change Vim will 15218144c84SBram Moolenaar create a branch in the undo tree. This means you can go back to any 153143c38cdSBram Moolenaar state of the text, there is no risk of a change causing text to be 15418144c84SBram Moolenaar lost forever. |undo-tree| 155dc1f1645SBram Moolenaar The undo information is stored in a file when the 'undofile' option is 156dc1f1645SBram Moolenaar set. This means you can exit Vim, start Vim on a previously edited 157dc1f1645SBram Moolenaar file and undo changes that were made before exiting Vim. 158071d4279SBram Moolenaar 15918144c84SBram MoolenaarGraphical User Interface (GUI). |gui| 160071d4279SBram Moolenaar Included support for GUI: menu's, mouse, scrollbars, etc. You can 161071d4279SBram Moolenaar define your own menus. Better support for CTRL/SHIFT/ALT keys in 162071d4279SBram Moolenaar combination with special keys and mouse. Supported for various 163071d4279SBram Moolenaar platforms, such as X11 (with Motif and Athena interfaces), GTK, Win32 1646938e27aSBram Moolenaar (Windows XP and later), Amiga and Macintosh. 165071d4279SBram Moolenaar 166071d4279SBram MoolenaarMultiple windows and buffers. |windows.txt| 167071d4279SBram Moolenaar Vim can split the screen into several windows, each editing a 168071d4279SBram Moolenaar different buffer or the same buffer at a different location. Buffers 169071d4279SBram Moolenaar can still be loaded (and changed) but not displayed in a window. This 170071d4279SBram Moolenaar is called a hidden buffer. Many commands and options have been added 171071d4279SBram Moolenaar for this facility. 17218144c84SBram Moolenaar Vim can also use multiple tab pages, each with one or more windows. A 17318144c84SBram Moolenaar line with tab labels can be used to quickly switch between these pages. 17418144c84SBram Moolenaar |tab-page| 175071d4279SBram Moolenaar 17625c9c680SBram MoolenaarTerminal window. |:terminal| 17725c9c680SBram Moolenaar Vim can create a window in which a terminal emulator runs. This can 17825c9c680SBram Moolenaar be used to execute an arbitrary command, a shell or a debugger. 17925c9c680SBram Moolenaar 180071d4279SBram MoolenaarSyntax highlighting. |:syntax| 181071d4279SBram Moolenaar Vim can highlight keywords, patterns and other things. This is 18218144c84SBram Moolenaar defined by a number of |:syntax| commands, and can be made to 183071d4279SBram Moolenaar highlight most languages and file types. A number of files are 184071d4279SBram Moolenaar included for highlighting the most common languages, like C, C++, 185071d4279SBram Moolenaar Java, Pascal, Makefiles, shell scripts, etc. The colors used for 186071d4279SBram Moolenaar highlighting can be defined for ordinary terminals, color terminals 18718144c84SBram Moolenaar and the GUI with the |:highlight| command. A convenient way to do 18818144c84SBram Moolenaar this is using a |:colorscheme| command. 18918144c84SBram Moolenaar The highlighted text can be exported as HTML. |convert-to-HTML| 19018144c84SBram Moolenaar Other items that can be highlighted are matches with the search string 19118144c84SBram Moolenaar |'hlsearch'|, matching parens |matchparen| and the cursor line and 19218144c84SBram Moolenaar column |'cursorline'| |'cursorcolumn'|. 193071d4279SBram Moolenaar 19425c9c680SBram MoolenaarText properties |textprop.txt| 19525c9c680SBram Moolenaar Vim supports highlighting text by a plugin. Property types can be 19668e6560bSBram Moolenaar specified with |prop_type_add()| and properties can be placed with 19725c9c680SBram Moolenaar |prop_add()|. 19825c9c680SBram Moolenaar 19918144c84SBram MoolenaarSpell checking. |spell| 20018144c84SBram Moolenaar When the 'spell' option is set Vim will highlight spelling mistakes. 2019b451250SBram Moolenaar About 50 languages are currently supported, selected with the 202f233048aSBram Moolenaar 'spelllang' option. In source code only comments and strings are 20318144c84SBram Moolenaar checked for spelling. 20418144c84SBram Moolenaar 20518144c84SBram MoolenaarFolding. |folding| 206071d4279SBram Moolenaar A range of lines can be shown as one "folded" line. This allows 207071d4279SBram Moolenaar overviewing a file and moving blocks of text around quickly. 208071d4279SBram Moolenaar Folds can be created manually, from the syntax of the file, by indent, 209071d4279SBram Moolenaar etc. 210071d4279SBram Moolenaar 21118144c84SBram MoolenaarDiff mode. |diff| 21218144c84SBram Moolenaar Vim can show two versions of a file with the differences highlighted. 21318144c84SBram Moolenaar Parts of the text that are equal are folded away. Commands can be 21418144c84SBram Moolenaar used to move text from one version to the other. 21518144c84SBram Moolenaar 21618144c84SBram MoolenaarPlugins. |add-plugin| 217071d4279SBram Moolenaar The functionality can be extended by dropping a plugin file in the 218071d4279SBram Moolenaar right directory. That's an easy way to start using Vim scripts 219071d4279SBram Moolenaar written by others. Plugins can be for all kind of files, or 220071d4279SBram Moolenaar specifically for a filetype. 221dc1f1645SBram Moolenaar Packages make this even easier. |packages| 222dc1f1645SBram Moolenaar 223dc1f1645SBram MoolenaarAsynchronous communication and timers. |channel| |job| |timer| 224dc1f1645SBram Moolenaar Vim can exchange messages with other processes in the background. 225dc1f1645SBram Moolenaar This makes it possible to have servers do work and send back the 226dc1f1645SBram Moolenaar results to Vim. |channel| 227dc1f1645SBram Moolenaar Vim can start a job, communicate with it and stop it. |job| 228dc1f1645SBram Moolenaar Timers can fire once or repeatedly and invoke a function to do any 229dc1f1645SBram Moolenaar work. |timer| 230071d4279SBram Moolenaar 231071d4279SBram MoolenaarRepeat a series of commands. |q| 23218144c84SBram Moolenaar "q{c}" starts recording typed characters into named register {c}. 23318144c84SBram Moolenaar A subsequent "q" stops recording. The register can then be executed 23418144c84SBram Moolenaar with the "@{c}" command. This is very useful to repeat a complex 23518144c84SBram Moolenaar action. 236071d4279SBram Moolenaar 237071d4279SBram MoolenaarFlexible insert mode. |ins-special-special| 238071d4279SBram Moolenaar The arrow keys can be used in insert mode to move around in the file. 239071d4279SBram Moolenaar This breaks the insert in two parts as far as undo and redo is 240071d4279SBram Moolenaar concerned. 241071d4279SBram Moolenaar 24218144c84SBram Moolenaar CTRL-O can be used to execute a single Normal mode command. This is 24318144c84SBram Moolenaar almost the same as hitting <Esc>, typing the command and doing |a|. 244071d4279SBram Moolenaar 245071d4279SBram MoolenaarVisual mode. |Visual-mode| 24618144c84SBram Moolenaar Visual mode can be used to first highlight a piece of text and then 24718144c84SBram Moolenaar give a command to do something with it. This is an (easy to use) 24818144c84SBram Moolenaar alternative to first giving the operator and then moving to the end of 24918144c84SBram Moolenaar the text to be operated upon. 25018144c84SBram Moolenaar |v| and |V| are used to start Visual mode. |v| works on characters 25118144c84SBram Moolenaar and |V| on lines. Move the cursor to extend the Visual area. It is 25218144c84SBram Moolenaar shown highlighted on the screen. By typing "o" the other end of the 25318144c84SBram Moolenaar Visual area can be moved. The Visual area can be affected by an 25418144c84SBram Moolenaar operator: 255071d4279SBram Moolenaar d delete 256071d4279SBram Moolenaar c change 257071d4279SBram Moolenaar y yank 258071d4279SBram Moolenaar > or < insert or delete indent 259071d4279SBram Moolenaar ! filter through external program 260071d4279SBram Moolenaar = filter through indent 26118144c84SBram Moolenaar : start |:| command for the Visual lines. 262071d4279SBram Moolenaar gq format text to 'textwidth' columns 263071d4279SBram Moolenaar J join lines 264071d4279SBram Moolenaar ~ swap case 265071d4279SBram Moolenaar u make lowercase 266071d4279SBram Moolenaar U make uppercase 26725c9c680SBram Moolenaar {Vi has no Visual mode, the name "visual" is used for Normal mode, to 26825c9c680SBram Moolenaar distinguish it from Ex mode} 269071d4279SBram Moolenaar 270071d4279SBram MoolenaarBlock operators. |visual-block| 27118144c84SBram Moolenaar With Visual mode a rectangular block of text can be selected. Start 27218144c84SBram Moolenaar Visual mode with CTRL-V. The block can be deleted ("d"), yanked ("y") 27318144c84SBram Moolenaar or its case can be changed ("~", "u" and "U"). A deleted or yanked 27418144c84SBram Moolenaar block can be put into the text with the "p" and "P" commands. 275071d4279SBram Moolenaar 27618144c84SBram MoolenaarHelp system. |:help| 277071d4279SBram Moolenaar Help is displayed in a window. The usual commands can be used to 278071d4279SBram Moolenaar move around, search for a string, etc. Tags can be used to jump 27918144c84SBram Moolenaar around in the help files, just like hypertext links. The |:help| 280071d4279SBram Moolenaar command takes an argument to quickly jump to the info on a subject. 281071d4279SBram Moolenaar <F1> is the quick access to the help system. The name of the help 282071d4279SBram Moolenaar index file can be set with the 'helpfile' option. 283071d4279SBram Moolenaar 284071d4279SBram MoolenaarCommand-line editing and history. |cmdline-editing| 285071d4279SBram Moolenaar You can insert or delete at any place in the command-line using the 286071d4279SBram Moolenaar cursor keys. The right/left cursor keys can be used to move 287071d4279SBram Moolenaar forward/backward one character. The shifted right/left cursor keys 288071d4279SBram Moolenaar can be used to move forward/backward one word. CTRL-B/CTRL-E can be 289071d4279SBram Moolenaar used to go to the begin/end of the command-line. 290a6c27c47SBram Moolenaar {Vi: can only alter the last character in the line} 291a6c27c47SBram Moolenaar {Vi: when hitting <Esc> the command-line is executed. This is 292a6c27c47SBram Moolenaar unexpected for most people; therefore it was changed in Vim. But when 293a6c27c47SBram Moolenaar the <Esc> is part of a mapping, the command-line is executed. If you 294a6c27c47SBram Moolenaar want the Vi behaviour also when typing <Esc>, use ":cmap ^V<Esc> 295a6c27c47SBram Moolenaar ^V^M"} 296071d4279SBram Moolenaar |cmdline-history| 297071d4279SBram Moolenaar The command-lines are remembered. The up/down cursor keys can be used 298071d4279SBram Moolenaar to recall previous command-lines. The 'history' option can be set to 299071d4279SBram Moolenaar the number of lines that will be remembered. There is a separate 300071d4279SBram Moolenaar history for commands and for search patterns. 301071d4279SBram Moolenaar 302071d4279SBram MoolenaarCommand-line completion. |cmdline-completion| 303071d4279SBram Moolenaar While entering a command-line (on the bottom line of the screen) 304071d4279SBram Moolenaar <Tab> can be typed to complete 305071d4279SBram Moolenaar what example ~ 306071d4279SBram Moolenaar - command :e<Tab> 307071d4279SBram Moolenaar - tag :ta scr<Tab> 308071d4279SBram Moolenaar - option :set sc<Tab> 309071d4279SBram Moolenaar - option value :set hf=<Tab> 310071d4279SBram Moolenaar - file name :e ve<Tab> 311071d4279SBram Moolenaar - etc. 312071d4279SBram Moolenaar 313071d4279SBram Moolenaar If there are multiple matches, CTRL-N (next) and CTRL-P (previous) 314071d4279SBram Moolenaar will walk through the matches. <Tab> works like CTRL-N, but wraps 315071d4279SBram Moolenaar around to the first match. 316071d4279SBram Moolenaar 317071d4279SBram Moolenaar The 'wildchar' option can be set to the character for command-line 318071d4279SBram Moolenaar completion, <Tab> is the default. CTRL-D can be typed after an 319071d4279SBram Moolenaar (incomplete) wildcard; all matches will be listed. CTRL-A will insert 320071d4279SBram Moolenaar all matches. CTRL-L will insert the longest common part of the 321071d4279SBram Moolenaar matches. 322071d4279SBram Moolenaar 32318144c84SBram MoolenaarInsert-mode completion. |ins-completion| 32418144c84SBram Moolenaar In Insert mode the CTRL-N and CTRL-P keys can be used to complete a 32518144c84SBram Moolenaar word that appears elsewhere. |i_CTRL-N| 326071d4279SBram Moolenaar With CTRL-X another mode is entered, through which completion can be 327071d4279SBram Moolenaar done for: 328071d4279SBram Moolenaar |i_CTRL-X_CTRL-F| file names 329071d4279SBram Moolenaar |i_CTRL-X_CTRL-K| words from 'dictionary' files 330071d4279SBram Moolenaar |i_CTRL-X_CTRL-T| words from 'thesaurus' files 331071d4279SBram Moolenaar |i_CTRL-X_CTRL-I| words from included files 332071d4279SBram Moolenaar |i_CTRL-X_CTRL-L| whole lines 333071d4279SBram Moolenaar |i_CTRL-X_CTRL-]| words from the tags file 334071d4279SBram Moolenaar |i_CTRL-X_CTRL-D| definitions or macros 33518144c84SBram Moolenaar |i_CTRL-X_CTRL-O| Omni completion: clever completion 33618144c84SBram Moolenaar specifically for a file type 33718144c84SBram Moolenaar etc. 338071d4279SBram Moolenaar 33918144c84SBram MoolenaarLong line support. |'wrap'| |'linebreak'| 340071d4279SBram Moolenaar If the 'wrap' option is off, long lines will not wrap and only part 341071d4279SBram Moolenaar of them will be shown. When the cursor is moved to a part that is not 342071d4279SBram Moolenaar shown, the screen will scroll horizontally. The minimum number of 34318144c84SBram Moolenaar columns to scroll can be set with the 'sidescroll' option. The |zh| 34418144c84SBram Moolenaar and |zl| commands can be used to scroll sideways. 345071d4279SBram Moolenaar Alternatively, long lines are broken in between words when the 346071d4279SBram Moolenaar 'linebreak' option is set. This allows editing a single-line 347071d4279SBram Moolenaar paragraph conveniently (e.g. when the text is later read into a DTP 34818144c84SBram Moolenaar program). Move the cursor up/down with the |gk| and |gj| commands. 349071d4279SBram Moolenaar 350071d4279SBram MoolenaarText formatting. |formatting| 351071d4279SBram Moolenaar The 'textwidth' option can be used to automatically limit the line 352071d4279SBram Moolenaar length. This supplements the 'wrapmargin' option of Vi, which was not 35318144c84SBram Moolenaar very useful. The |gq| operator can be used to format a piece of text 35418144c84SBram Moolenaar (for example, |gqap| formats the current paragraph). Commands for 35518144c84SBram Moolenaar text alignment: |:center|, |:left| and |:right|. 356071d4279SBram Moolenaar 35718144c84SBram MoolenaarExtended search patterns. |pattern| 358071d4279SBram Moolenaar There are many extra items to match various text items. Examples: 359071d4279SBram Moolenaar A "\n" can be used in a search pattern to match a line break. 360071d4279SBram Moolenaar "x\{2,4}" matches "x" 2 to 4 times. 361071d4279SBram Moolenaar "\s" matches a white space character. 362071d4279SBram Moolenaar 36318144c84SBram MoolenaarDirectory, remote and archive browsing. |netrw| 36418144c84SBram Moolenaar Vim can browse the file system. Simply edit a directory. Move around 36518144c84SBram Moolenaar in the list with the usual commands and press <Enter> to go to the 36618144c84SBram Moolenaar directory or file under the cursor. 36718144c84SBram Moolenaar This also works for remote files over ftp, http, ssh, etc. 36818144c84SBram Moolenaar Zip and tar archives can also be browsed. |tar| |zip| 36918144c84SBram Moolenaar 370071d4279SBram MoolenaarEdit-compile-edit speedup. |quickfix| 37118144c84SBram Moolenaar The |:make| command can be used to run the compilation and jump to the 37218144c84SBram Moolenaar first error. A file with compiler error messages is interpreted. Vim 37318144c84SBram Moolenaar jumps to the first error. 374071d4279SBram Moolenaar 375071d4279SBram Moolenaar Each line in the error file is scanned for the name of a file, line 376071d4279SBram Moolenaar number and error message. The 'errorformat' option can be set to a 377071d4279SBram Moolenaar list of scanf-like strings to handle output from many compilers. 378071d4279SBram Moolenaar 37918144c84SBram Moolenaar The |:cn| command can be used to jump to the next error. 38018144c84SBram Moolenaar |:cl| lists all the error messages. Other commands are available. 381071d4279SBram Moolenaar The 'makeef' option has the name of the file with error messages. 382071d4279SBram Moolenaar The 'makeprg' option contains the name of the program to be executed 38318144c84SBram Moolenaar with the |:make| command. 384071d4279SBram Moolenaar The 'shellpipe' option contains the string to be used to put the 385071d4279SBram Moolenaar output of the compiler into the errorfile. 386071d4279SBram Moolenaar 38718144c84SBram MoolenaarFinding matches in files. |:vimgrep| 38818144c84SBram Moolenaar Vim can search for a pattern in multiple files. This uses the 38918144c84SBram Moolenaar advanced Vim regexp pattern, works on all systems and also works to 39018144c84SBram Moolenaar search in compressed files. 39118144c84SBram Moolenaar 39218144c84SBram MoolenaarImproved indenting for programs. |'cindent'| 393071d4279SBram Moolenaar When the 'cindent' option is on the indent of each line is 394071d4279SBram Moolenaar automatically adjusted. C syntax is mostly recognized. The indent 395071d4279SBram Moolenaar for various styles can be set with 'cinoptions'. The keys to trigger 396071d4279SBram Moolenaar indenting can be set with 'cinkeys'. 397071d4279SBram Moolenaar 398071d4279SBram Moolenaar Comments can be automatically formatted. The 'comments' option can be 399071d4279SBram Moolenaar set to the characters that start and end a comment. This works best 400071d4279SBram Moolenaar for C code, but also works for e-mail (">" at start of the line) and 40118144c84SBram Moolenaar other types of text. The |=| operator can be used to re-indent 402071d4279SBram Moolenaar lines. 403071d4279SBram Moolenaar 40418144c84SBram Moolenaar For many other languages an indent plugin is present to support 40518144c84SBram Moolenaar automatic indenting. |30.3| 40618144c84SBram Moolenaar 40718144c84SBram MoolenaarSearching for words in included files. |include-search| 40818144c84SBram Moolenaar The |[i| command can be used to search for a match of the word under 409071d4279SBram Moolenaar the cursor in the current and included files. The 'include' option 410c236c16dSBram Moolenaar can be set to a pattern that describes a command to include a file 411071d4279SBram Moolenaar (the default is for C programs). 41218144c84SBram Moolenaar The |[I| command lists all matches, the |[_CTRL-I| command jumps to 413071d4279SBram Moolenaar a match. 41418144c84SBram Moolenaar The |[d|, |[D| and |[_CTRL-D| commands do the same, but only for 415071d4279SBram Moolenaar lines where the pattern given with the 'define' option matches. 416071d4279SBram Moolenaar 41718144c84SBram MoolenaarAutomatic commands. |autocommand| 418071d4279SBram Moolenaar Commands can be automatically executed when reading a file, writing a 419071d4279SBram Moolenaar file, jumping to another buffer, etc., depending on the file name. 420071d4279SBram Moolenaar This is useful to set options and mappings for C programs, 421071d4279SBram Moolenaar documentation, plain text, e-mail, etc. This also makes it possible 422071d4279SBram Moolenaar to edit compressed files. 423071d4279SBram Moolenaar 42418144c84SBram MoolenaarScripts and Expressions. |expression| 42518144c84SBram Moolenaar Commands have been added to form up a powerful script language. 426071d4279SBram Moolenaar |:if| Conditional execution, which can be used for example 427071d4279SBram Moolenaar to set options depending on the value of $TERM. 428071d4279SBram Moolenaar |:while| Repeat a number of commands. 42918144c84SBram Moolenaar |:for| Loop over a list. 430071d4279SBram Moolenaar |:echo| Print the result of an expression. 431071d4279SBram Moolenaar |:let| Assign a value to an internal variable, option, etc. 43218144c84SBram Moolenaar Variable types are Number, String, List and Dictionary. 433071d4279SBram Moolenaar |:execute| Execute a command formed by an expression. 43418144c84SBram Moolenaar |:try| Catch exceptions. 43518144c84SBram Moolenaar etc., etc. See |eval|. 43618144c84SBram Moolenaar Debugging and profiling are supported. |debug-scripts| |profile| 43718144c84SBram Moolenaar If this is not enough, an interface is provided to |Python|, |Ruby|, 4380ba04296SBram Moolenaar |Tcl|, |Lua|, |Perl| and |MzScheme|. 439071d4279SBram Moolenaar 44018144c84SBram MoolenaarViminfo. |viminfo-file| 441071d4279SBram Moolenaar The command-line history, marks and registers can be stored in a file 442071d4279SBram Moolenaar that is read on startup. This can be used to repeat a search command 443071d4279SBram Moolenaar or command-line command after exiting and restarting Vim. It is also 44418144c84SBram Moolenaar possible to jump right back to where the last edit stopped with |'0|. 445071d4279SBram Moolenaar The 'viminfo' option can be set to select which items to store in the 446071d4279SBram Moolenaar .viminfo file. This is off by default. 447071d4279SBram Moolenaar 44818144c84SBram MoolenaarPrinting. |printing| 44918144c84SBram Moolenaar The |:hardcopy| command sends text to the printer. This can include 45018144c84SBram Moolenaar syntax highlighting. 45118144c84SBram Moolenaar 45218144c84SBram MoolenaarMouse support. |mouse-using| 453071d4279SBram Moolenaar The mouse is supported in the GUI version, in an xterm for Unix, for 4545666fcd0SBram Moolenaar BSDs with sysmouse, for Linux with gpm, and Win32. It can be used to 4555666fcd0SBram Moolenaar position the cursor, select the visual area, paste a register, etc. 456071d4279SBram Moolenaar 45718144c84SBram MoolenaarUsage of key names. |<>| |key-notation| 458071d4279SBram Moolenaar Special keys now all have a name like <Up>, <End>, etc. 459071d4279SBram Moolenaar This name can be used in mappings, to make it easy to edit them. 460071d4279SBram Moolenaar 46118144c84SBram MoolenaarEditing binary files. |edit-binary| 462071d4279SBram Moolenaar Vim can edit binary files. You can change a few characters in an 463071d4279SBram Moolenaar executable file, without corrupting it. Vim doesn't remove NUL 464071d4279SBram Moolenaar characters (they are represented as <NL> internally). 465071d4279SBram Moolenaar |-b| command-line argument to start editing a binary file 46618144c84SBram Moolenaar |'binary'| Option set by |-b|. Prevents adding an <EOL> for the 467071d4279SBram Moolenaar last line in the file. 468071d4279SBram Moolenaar 46918144c84SBram MoolenaarMulti-language support. |multi-lang| 470207f0093SBram Moolenaar Files in double-byte or multibyte encodings can be edited. There is 471071d4279SBram Moolenaar UTF-8 support to be able to edit various languages at the same time, 472071d4279SBram Moolenaar without switching fonts. |UTF-8| 473071d4279SBram Moolenaar Messages and menus are available in different languages. 474071d4279SBram Moolenaar 47518144c84SBram MoolenaarMove cursor beyond lines. 47618144c84SBram Moolenaar When the 'virtualedit' option is set the cursor can move all over the 47718144c84SBram Moolenaar screen, also where there is no text. This is useful to edit tables 47818144c84SBram Moolenaar and figures easily. 47918144c84SBram Moolenaar 480071d4279SBram Moolenaar============================================================================== 481071d4279SBram Moolenaar5. Other vim features *other-features* 482071d4279SBram Moolenaar 483071d4279SBram MoolenaarA random collection of nice extra features. 484071d4279SBram Moolenaar 485071d4279SBram Moolenaar 486071d4279SBram MoolenaarWhen Vim is started with "-s scriptfile", the characters read from 487071d4279SBram Moolenaar"scriptfile" are treated as if you typed them. If end of file is reached 488071d4279SBram Moolenaarbefore the editor exits, further characters are read from the console. 489071d4279SBram Moolenaar 490071d4279SBram MoolenaarThe "-w" option can be used to record all typed characters in a script file. 491071d4279SBram MoolenaarThis file can then be used to redo the editing, possibly on another file or 492071d4279SBram Moolenaarafter changing some commands in the script file. 493071d4279SBram Moolenaar 494071d4279SBram MoolenaarThe "-o" option opens a window for each argument. "-o4" opens four windows. 495071d4279SBram Moolenaar 496071d4279SBram MoolenaarVi requires several termcap entries to be able to work full-screen. Vim only 497071d4279SBram Moolenaarrequires the "cm" entry (cursor motion). 498071d4279SBram Moolenaar 499071d4279SBram Moolenaar 500071d4279SBram MoolenaarIn command mode: 501071d4279SBram Moolenaar 502071d4279SBram MoolenaarWhen the 'showcmd' option is set, the command characters are shown in the last 503071d4279SBram Moolenaarline of the screen. They are removed when the command is finished. 504071d4279SBram Moolenaar 505071d4279SBram MoolenaarIf the 'ruler' option is set, the current cursor position is shown in the 506071d4279SBram Moolenaarlast line of the screen. 507071d4279SBram Moolenaar 508071d4279SBram Moolenaar"U" still works after having moved off the last changed line and after "u". 509071d4279SBram Moolenaar 510071d4279SBram MoolenaarCharacters with the 8th bit set are displayed. The characters between '~' and 511071d4279SBram Moolenaar0xa0 are displayed as "~?", "~@", "~A", etc., unless they are included in the 512071d4279SBram Moolenaar'isprint' option. 513071d4279SBram Moolenaar 514071d4279SBram Moolenaar"][" goes to the next ending of a C function ('}' in column 1). 515071d4279SBram Moolenaar"[]" goes to the previous ending of a C function ('}' in column 1). 516071d4279SBram Moolenaar 517071d4279SBram Moolenaar"]f", "[f" and "gf" start editing the file whose name is under the cursor. 518071d4279SBram MoolenaarCTRL-W f splits the window and starts editing the file whose name is under 519071d4279SBram Moolenaarthe cursor. 520071d4279SBram Moolenaar 521071d4279SBram Moolenaar"*" searches forward for the identifier under the cursor, "#" backward. 522071d4279SBram Moolenaar"K" runs the program defined by the 'keywordprg' option, with the identifier 523071d4279SBram Moolenaarunder the cursor as argument. 524071d4279SBram Moolenaar 525071d4279SBram Moolenaar"%" can be preceded with a count. The cursor jumps to the line that 526071d4279SBram Moolenaarpercentage down in the file. The normal "%" function to jump to the matching 527071d4279SBram Moolenaarbrace skips braces inside quotes. 528071d4279SBram Moolenaar 529071d4279SBram MoolenaarWith the CTRL-] command, the cursor may be in the middle of the identifier. 530071d4279SBram Moolenaar 531071d4279SBram MoolenaarThe used tags are remembered. Commands that can be used with the tag stack 532071d4279SBram Moolenaarare CTRL-T, ":pop" and ":tag". ":tags" lists the tag stack. 533071d4279SBram Moolenaar 53425c9c680SBram MoolenaarVi uses 'wrapscan' when searching for a tag. When jumping to a tag Vi starts 53525c9c680SBram Moolenaarsearching in line 2 of another file. It does not find a tag in line 1 of 53625c9c680SBram Moolenaaranother file when 'wrapscan' is not set. 53725c9c680SBram Moolenaar 538071d4279SBram MoolenaarThe 'tags' option can be set to a list of tag file names. Thus multiple 539071d4279SBram Moolenaartag files can be used. For file names that start with "./", the "./" is 540071d4279SBram Moolenaarreplaced with the path of the current file. This makes it possible to use a 541071d4279SBram Moolenaartags file in the same directory as the file being edited. 542a6c27c47SBram Moolenaar{Vi: always uses binary search in some versions} 543a6c27c47SBram Moolenaar{Vi does not have the security prevention for commands in tag files} 544071d4279SBram Moolenaar 545071d4279SBram MoolenaarPreviously used file names are remembered in the alternate file name list. 546071d4279SBram MoolenaarCTRL-^ accepts a count, which is an index in this list. 547071d4279SBram Moolenaar":files" command shows the list of alternate file names. 548071d4279SBram Moolenaar"#<N>" is replaced with the <N>th alternate file name in the list. 549071d4279SBram Moolenaar"#<" is replaced with the current file name without extension. 550071d4279SBram Moolenaar 551071d4279SBram MoolenaarSearch patterns have more features. The <NL> character is seen as part of the 552071d4279SBram Moolenaarsearch pattern and the substitute string of ":s". Vi sees it as the end of 553071d4279SBram Moolenaarthe command. 554071d4279SBram Moolenaar 555071d4279SBram MoolenaarSearches can put the cursor on the end of a match and may include a character 556071d4279SBram Moolenaaroffset. 557071d4279SBram Moolenaar 558071d4279SBram MoolenaarCount added to "~", ":next", ":Next", "n" and "N". 559071d4279SBram Moolenaar 560071d4279SBram MoolenaarThe command ":next!" with 'autowrite' set does not write the file. In vi the 561071d4279SBram Moolenaarfile was written, but this is considered to be a bug, because one does not 562071d4279SBram Moolenaarexpect it and the file is not written with ":rewind!". 563071d4279SBram Moolenaar 564071d4279SBram MoolenaarIn Vi when entering a <CR> in replace mode deletes a character only when 'ai' 565071d4279SBram Moolenaaris set (but does not show it until you hit <Esc>). Vim always deletes a 566071d4279SBram Moolenaarcharacter (and shows it immediately). 567071d4279SBram Moolenaar 568071d4279SBram MoolenaarAdded :wnext command. Same as ":write" followed by ":next". 569071d4279SBram Moolenaar 570071d4279SBram MoolenaarThe ":w!" command always writes, also when the file is write protected. In Vi 57126df0928SBram Moolenaaryou would have to do ":!chmod +w %:S" and ":set noro". 572071d4279SBram Moolenaar 573071d4279SBram MoolenaarWhen 'tildeop' has been set, "~" is an operator (must be followed by a 574071d4279SBram Moolenaarmovement command). 575071d4279SBram Moolenaar 576071d4279SBram MoolenaarWith the "J" (join) command you can reset the 'joinspaces' option to have only 577071d4279SBram Moolenaarone space after a period (Vi inserts two spaces). 578071d4279SBram Moolenaar 579071d4279SBram Moolenaar"cw" can be used to change white space formed by several characters (Vi is 580071d4279SBram Moolenaarconfusing: "cw" only changes one space, while "dw" deletes all white space). 581a6c27c47SBram Moolenaar{Vi: "cw" when on a blank followed by other blanks changes only the first 582a6c27c47SBram Moolenaarblank; this is probably a bug, because "dw" deletes all the blanks} 583071d4279SBram Moolenaar 584071d4279SBram Moolenaar"o" and "O" accept a count for repeating the insert (Vi clears a part of 585071d4279SBram Moolenaardisplay). 586071d4279SBram Moolenaar 587071d4279SBram MoolenaarFlags after Ex commands not supported (no plans to include it). 588071d4279SBram Moolenaar 589071d4279SBram MoolenaarOn non-UNIX systems ":cd" command shows current directory instead of going to 590071d4279SBram Moolenaarthe home directory (there isn't one). ":pwd" prints the current directory on 591071d4279SBram Moolenaarall systems. 592071d4279SBram Moolenaar 593071d4279SBram MoolenaarAfter a ":cd" command the file names (in the argument list, opened files) 594071d4279SBram Moolenaarstill point to the same files. In Vi ":cd" is not allowed in a changed file; 595071d4279SBram Moolenaarotherwise the meaning of file names change. 596071d4279SBram Moolenaar 597071d4279SBram Moolenaar":source!" command reads Vi commands from a file. 598071d4279SBram Moolenaar 599071d4279SBram Moolenaar":mkexrc" command writes current modified options and mappings to a ".exrc" 600071d4279SBram Moolenaarfile. ":mkvimrc" writes to a ".vimrc" file. 601071d4279SBram Moolenaar 602071d4279SBram MoolenaarNo check for "tail recursion" with mappings. This allows things like 603071d4279SBram Moolenaar":map! foo ^]foo". 604071d4279SBram Moolenaar 605071d4279SBram MoolenaarWhen a mapping starts with number, vi loses the count typed before it (e.g. 606071d4279SBram Moolenaarwhen using the mapping ":map g 4G" the command "7g" goes to line 4). This is 607071d4279SBram Moolenaarconsidered a vi bug. Vim concatenates the counts (in the example it becomes 608071d4279SBram Moolenaar"74G"), as most people would expect. 609071d4279SBram Moolenaar 610071d4279SBram MoolenaarThe :put! command inserts the contents of a register above the current line. 611071d4279SBram Moolenaar 612071d4279SBram MoolenaarThe "p" and "P" commands of vi cannot be repeated with "." when the putted 613071d4279SBram Moolenaartext is less than a line. In Vim they can always be repeated. 614071d4279SBram Moolenaar 615071d4279SBram Moolenaar":noremap" command can be used to enter a mapping that will not be remapped. 616071d4279SBram MoolenaarThis is useful to exchange the meaning of two keys. ":cmap", ":cunmap" and 617071d4279SBram Moolenaar":cnoremap" can be used for mapping in command-line editing only. ":imap", 618071d4279SBram Moolenaar":iunmap" and ":inoremap" can be used for mapping in insert mode only. 619071d4279SBram MoolenaarSimilar commands exist for abbreviations: ":noreabbrev", ":iabbrev" 620071d4279SBram Moolenaar":cabbrev", ":iunabbrev", ":cunabbrev", ":inoreabbrev", ":cnoreabbrev". 621071d4279SBram Moolenaar 622071d4279SBram MoolenaarIn Vi the command ":map foo bar" would remove a previous mapping 623071d4279SBram Moolenaar":map bug foo". This is considered a bug, so it is not included in Vim. 624071d4279SBram Moolenaar":unmap! foo" does remove ":map! bug foo", because unmapping would be very 625071d4279SBram Moolenaardifficult otherwise (this is vi compatible). 626071d4279SBram Moolenaar 627071d4279SBram MoolenaarThe ':' register contains the last command-line. 628071d4279SBram MoolenaarThe '%' register contains the current file name. 629071d4279SBram MoolenaarThe '.' register contains the last inserted text. 630071d4279SBram Moolenaar 631071d4279SBram Moolenaar":dis" command shows the contents of the yank registers. 632071d4279SBram Moolenaar 633071d4279SBram MoolenaarCTRL-O/CTRL-I can be used to jump to older/newer positions. These are the 634071d4279SBram Moolenaarsame positions as used with the '' command, but may be in another file. The 635071d4279SBram Moolenaar":jumps" command lists the older positions. 636071d4279SBram Moolenaar 637071d4279SBram MoolenaarIf the 'shiftround' option is set, an indent is rounded to a multiple of 638071d4279SBram Moolenaar'shiftwidth' with ">" and "<" commands. 639071d4279SBram Moolenaar 640071d4279SBram MoolenaarThe 'scrolljump' option can be set to the minimum number of lines to scroll 641071d4279SBram Moolenaarwhen the cursor gets off the screen. Use this when scrolling is slow. 642071d4279SBram Moolenaar 643071d4279SBram MoolenaarThe 'scrolloff' option can be set to the minimum number of lines to keep 644071d4279SBram Moolenaarabove and below the cursor. This gives some context to where you are 645071d4279SBram Moolenaarediting. When set to a large number the cursor line is always in the middle 646071d4279SBram Moolenaarof the window. 647071d4279SBram Moolenaar 648071d4279SBram MoolenaarUppercase marks can be used to jump between files. The ":marks" command lists 649071d4279SBram Moolenaarall currently set marks. The commands "']" and "`]" jump to the end of the 650071d4279SBram Moolenaarprevious operator or end of the text inserted with the put command. "'[" and 651a6c27c47SBram Moolenaar"`[" do jump to the start. {Vi: no uppercase marks} 652071d4279SBram Moolenaar 653071d4279SBram MoolenaarThe 'shelltype' option can be set to reflect the type of shell used on the 654071d4279SBram MoolenaarAmiga. 655071d4279SBram Moolenaar 656071d4279SBram MoolenaarThe 'highlight' option can be set for the highlight mode to be used for 657071d4279SBram Moolenaarseveral commands. 658071d4279SBram Moolenaar 659071d4279SBram MoolenaarThe CTRL-A (add) and CTRL-X (subtract) commands are new. The count to the 660071d4279SBram Moolenaarcommand (default 1) is added to/subtracted from the number at or after the 661071d4279SBram Moolenaarcursor. That number may be decimal, octal (starts with a '0') or hexadecimal 662071d4279SBram Moolenaar(starts with '0x'). Very useful in macros. 663071d4279SBram Moolenaar 664071d4279SBram MoolenaarWith the :set command the prefix "inv" can be used to invert boolean options. 665071d4279SBram Moolenaar 666071d4279SBram MoolenaarIn both Vi and Vim you can create a line break with the ":substitute" command 667071d4279SBram Moolenaarby using a CTRL-M. For Vi this means you cannot insert a real CTRL-M in the 668071d4279SBram Moolenaartext. With Vim you can put a real CTRL-M in the text by preceding it with a 669071d4279SBram MoolenaarCTRL-V. 670071d4279SBram Moolenaar 671071d4279SBram Moolenaar 672071d4279SBram MoolenaarIn Insert mode: 673071d4279SBram Moolenaar 674071d4279SBram MoolenaarIf the 'revins' option is set, insert happens backwards. This is for typing 675071d4279SBram MoolenaarHebrew. When inserting normal characters the cursor will not be shifted and 676071d4279SBram Moolenaarthe text moves rightwards. Backspace, CTRL-W and CTRL-U will also work in 677071d4279SBram Moolenaarthe opposite direction. CTRL-B toggles the 'revins' option. In replace mode 678071d4279SBram Moolenaar'revins' has no effect. Only when enabled at compile time. 679071d4279SBram Moolenaar 680071d4279SBram MoolenaarThe backspace key can be used just like CTRL-D to remove auto-indents. 681071d4279SBram Moolenaar 682071d4279SBram MoolenaarYou can backspace, CTRL-U and CTRL-W over line breaks if the 'backspace' (bs) 683071d4279SBram Moolenaaroption includes "eol". You can backspace over the start of insert if the 684071d4279SBram Moolenaar'backspace' option includes "start". 685071d4279SBram Moolenaar 6869b451250SBram MoolenaarWhen the 'paste' option is set, a few options are reset and mapping in insert 687071d4279SBram Moolenaarmode and abbreviation are disabled. This allows for pasting text in windowing 688071d4279SBram Moolenaarsystems without unexpected results. When the 'paste' option is reset, the old 689071d4279SBram Moolenaaroption values are restored. 690071d4279SBram Moolenaar 691071d4279SBram MoolenaarCTRL-T/CTRL-D always insert/delete an indent in the current line, no matter 692071d4279SBram Moolenaarwhat column the cursor is in. 693071d4279SBram Moolenaar 694071d4279SBram MoolenaarCTRL-@ (insert previously inserted text) works always (Vi: only when typed as 695071d4279SBram Moolenaarfirst character). 696071d4279SBram Moolenaar 697071d4279SBram MoolenaarCTRL-A works like CTRL-@ but does not leave insert mode. 698071d4279SBram Moolenaar 6995be4ceecSBram MoolenaarCTRL-R {register} can be used to insert the contents of a register. 700071d4279SBram Moolenaar 701071d4279SBram MoolenaarWhen the 'smartindent' option is set, C programs will be better auto-indented. 702071d4279SBram MoolenaarWith 'cindent' even more. 703071d4279SBram Moolenaar 704071d4279SBram MoolenaarCTRL-Y and CTRL-E can be used to copy a character from above/below the 705071d4279SBram Moolenaarcurrent cursor position. 706071d4279SBram Moolenaar 707071d4279SBram MoolenaarAfter CTRL-V you can enter a three digit decimal number. This byte value is 708071d4279SBram Moolenaarinserted in the text as a single character. Useful for international 709071d4279SBram Moolenaarcharacters that are not on your keyboard. 710071d4279SBram Moolenaar 711071d4279SBram MoolenaarWhen the 'expandtab' (et) option is set, a <Tab> is expanded to the 712071d4279SBram Moolenaarappropriate number of spaces. 713071d4279SBram Moolenaar 714071d4279SBram MoolenaarThe window always reflects the contents of the buffer (Vi does not do this 715071d4279SBram Moolenaarwhen changing text and in some other cases). 716071d4279SBram Moolenaar 717071d4279SBram MoolenaarIf Vim is compiled with DIGRAPHS defined, digraphs are supported. A set of 718071d4279SBram Moolenaarnormal digraphs is included. They are shown with the ":digraph" command. 719071d4279SBram MoolenaarMore can be added with ":digraph {char1}{char2} {number}". A digraph is 720071d4279SBram Moolenaarentered with "CTRL-K {char1} {char2}" or "{char1} BS {char2}" (only when 721071d4279SBram Moolenaar'digraph' option is set). 722071d4279SBram Moolenaar 723071d4279SBram MoolenaarWhen repeating an insert, e.g. "10atest <Esc>" vi would only handle wrapmargin 724071d4279SBram Moolenaarfor the first insert. Vim does it for all. 725071d4279SBram Moolenaar 726071d4279SBram MoolenaarA count to the "i" or "a" command is used for all the text. Vi uses the count 727071d4279SBram Moolenaaronly for one line. "3iabc<NL>def<Esc>" would insert "abcabcabc<NL>def" in Vi 728071d4279SBram Moolenaarbut "abc<NL>defabc<NL>defabc<NL>def" in Vim. 729071d4279SBram Moolenaar 730071d4279SBram Moolenaar 731071d4279SBram MoolenaarIn Command-line mode: 732071d4279SBram Moolenaar 733071d4279SBram Moolenaar<Esc> terminates the command-line without executing it. In vi the command 734071d4279SBram Moolenaarline would be executed, which is not what most people expect (hitting <Esc> 735071d4279SBram Moolenaarshould always get you back to command mode). To avoid problems with some 736071d4279SBram Moolenaarobscure macros, an <Esc> in a macro will execute the command. If you want a 737071d4279SBram Moolenaartyped <Esc> to execute the command like vi does you can fix this with 738071d4279SBram Moolenaar ":cmap ^V<Esc> ^V<CR>" 739071d4279SBram Moolenaar 740071d4279SBram MoolenaarGeneral: 741071d4279SBram Moolenaar 742071d4279SBram MoolenaarThe 'ttimeout' option is like 'timeout', but only works for cursor and 743071d4279SBram Moolenaarfunction keys, not for ordinary mapped characters. The 'timeoutlen' option 744071d4279SBram Moolenaargives the number of milliseconds that is waited for. If the 'esckeys' option 745071d4279SBram Moolenaaris not set, cursor and function keys that start with <Esc> are not recognized 746071d4279SBram Moolenaarin insert mode. 747071d4279SBram Moolenaar 748071d4279SBram MoolenaarThere is an option for each terminal string. Can be used when termcap is not 749071d4279SBram Moolenaarsupported or to change individual strings. 750071d4279SBram Moolenaar 751071d4279SBram MoolenaarThe 'fileformat' option can be set to select the <EOL>: "dos" <CR><NL>, "unix" 752071d4279SBram Moolenaar<NL> or "mac" <CR>. 753071d4279SBram MoolenaarWhen the 'fileformats' option is not empty, Vim tries to detect the type of 754071d4279SBram Moolenaar<EOL> automatically. The 'fileformat' option is set accordingly. 755071d4279SBram Moolenaar 756071d4279SBram MoolenaarOn systems that have no job control (older Unix systems and non-Unix systems) 757071d4279SBram Moolenaarthe CTRL-Z, ":stop" or ":suspend" command starts a new shell. 758071d4279SBram Moolenaar 759071d4279SBram MoolenaarIf Vim is started on the Amiga without an interactive window for output, a 760071d4279SBram Moolenaarwindow is opened (and :sh still works). You can give a device to use for 761071d4279SBram Moolenaarediting with the |-d| argument, e.g. "-d con:20/20/600/150". 762071d4279SBram Moolenaar 763071d4279SBram MoolenaarThe 'columns' and 'lines' options are used to set or get the width and height 764071d4279SBram Moolenaarof the display. 765071d4279SBram Moolenaar 766071d4279SBram MoolenaarOption settings are read from the first and last few lines of the file. 767071d4279SBram MoolenaarOption 'modelines' determines how many lines are tried (default is 5). Note 768071d4279SBram Moolenaarthat this is different from the Vi versions that can execute any Ex command 769071d4279SBram Moolenaarin a modeline (a major security problem). |trojan-horse| 770071d4279SBram Moolenaar 771071d4279SBram MoolenaarIf the 'insertmode' option is set (e.g. in .exrc), Vim starts in insert mode. 772071d4279SBram MoolenaarAnd it comes back there, when pressing <Esc>. 773071d4279SBram Moolenaar 774071d4279SBram MoolenaarUndo information is kept in memory. Available memory limits the number and 7755666fcd0SBram Moolenaarsize of change that can be undone. This is hardly a problem on the Amiga and 7765666fcd0SBram Moolenaaralmost never with Unix and Win32. 777071d4279SBram Moolenaar 778071d4279SBram MoolenaarIf the 'backup' or 'writebackup' option is set: Before a file is overwritten, 779071d4279SBram Moolenaara backup file (.bak) is made. If the "backup" option is set it is left 780071d4279SBram Moolenaarbehind. 781071d4279SBram Moolenaar 782071d4279SBram MoolenaarVim creates a file ending in ".swp" to store parts of the file that have been 783071d4279SBram Moolenaarchanged or that do not fit in memory. This file can be used to recover from 784071d4279SBram Moolenaaran aborted editing session with "vim -r file". Using the swap file can be 785071d4279SBram Moolenaarswitched off by setting the 'updatecount' option to 0 or starting Vim with 786071d4279SBram Moolenaarthe "-n" option. Use the 'directory' option for placing the .swp file 787071d4279SBram Moolenaarsomewhere else. 788071d4279SBram Moolenaar 789071d4279SBram MoolenaarVim is able to work correctly on filesystems with 8.3 file names, also when 790071d4279SBram Moolenaarusing messydos or crossdos filesystems on the Amiga, or any 8.3 mounted 791071d4279SBram Moolenaarfilesystem under Unix. See |'shortname'|. 792071d4279SBram Moolenaar 793071d4279SBram MoolenaarError messages are shown at least one second (Vi overwrites error messages). 794071d4279SBram Moolenaar 795071d4279SBram MoolenaarIf Vim gives the |hit-enter| prompt, you can hit any key. Characters other 796a6c27c47SBram Moolenaarthan <CR>, <NL> and <Space> are interpreted as the (start of) a command. 797a6c27c47SBram Moolenaar{Vi: only ":" commands are interpreted} 798071d4279SBram Moolenaar 799071d4279SBram MoolenaarThe contents of the numbered and unnamed registers is remembered when 800071d4279SBram Moolenaarchanging files. 801071d4279SBram Moolenaar 802071d4279SBram MoolenaarThe "No lines in buffer" message is a normal message instead of an error 803071d4279SBram Moolenaarmessage, since that may cause a mapping to be aborted. 804a6c27c47SBram Moolenaar{Vi: error messages may be overwritten with other messages before you have a 805a6c27c47SBram Moolenaarchance to read them} 806071d4279SBram Moolenaar 807071d4279SBram MoolenaarThe AUX: device of the Amiga is supported. 808071d4279SBram Moolenaar 809071d4279SBram Moolenaar============================================================================== 8106c60f47fSBram Moolenaar6. Supported Vi features *vi-features* 8116c60f47fSBram Moolenaar 8126c60f47fSBram MoolenaarVim supports nearly all Vi commands and mostly in the same way. That is when 8136c60f47fSBram Moolenaarthe 'compatible' option is set and 'cpoptions' contains all flags. What the 8146c60f47fSBram Moolenaareffect is of resetting 'compatible' and removing flags from 'cpoptions' can be 8156c60f47fSBram Moolenaarfound at the help for the specific command. 8166c60f47fSBram Moolenaar 81725c9c680SBram MoolenaarThe help files used to mark features that are in Vim but not in Vi with {not 81825c9c680SBram Moolenaarin Vi}. However, since these remarks cluttered the help files we now do it 81925c9c680SBram Moolenaarthe other way around: Below is listed what Vi already supported. Anything 82025c9c680SBram Moolenaarelse has been added by Vim. 82125c9c680SBram Moolenaar 8226c60f47fSBram Moolenaar 8236c60f47fSBram MoolenaarThe following Ex commands are supported by Vi: ~ 8246c60f47fSBram Moolenaar 82525c9c680SBram Moolenaar`:abbreviate` enter abbreviation 82625c9c680SBram Moolenaar`:append` append text 82725c9c680SBram Moolenaar`:args` print the argument list 82825c9c680SBram Moolenaar`:cd` change directory; Vi: no "cd -" 82925c9c680SBram Moolenaar`:change` replace a line or series of lines 83025c9c680SBram Moolenaar`:chdir` change directory 83125c9c680SBram Moolenaar`:copy` copy lines 83225c9c680SBram Moolenaar`:delete` delete lines 83325c9c680SBram Moolenaar`:edit` edit a file 834a6c27c47SBram Moolenaar`:exit` same as `:xit` 83525c9c680SBram Moolenaar`:file` show or set the current file name; Vi: without the column number 83625c9c680SBram Moolenaar`:global` execute commands for matching lines 83725c9c680SBram Moolenaar`:insert` insert text 83825c9c680SBram Moolenaar`:join` join lines; Vi: not :join! 83925c9c680SBram Moolenaar`:k` set a mark 84025c9c680SBram Moolenaar`:list` print lines 84125c9c680SBram Moolenaar`:map` show or enter a mapping 84225c9c680SBram Moolenaar`:mark` set a mark 84325c9c680SBram Moolenaar`:move` move lines 844a6c27c47SBram Moolenaar`:Next` go to previous file in the argument list {Vi: no count} 845a6c27c47SBram Moolenaar`:next` go to next file in the argument list {Vi: no count} 84625c9c680SBram Moolenaar`:number` print lines with line number 84725c9c680SBram Moolenaar`:open` start open mode (not implemented in Vim) 84825c9c680SBram Moolenaar`:pop` jump to older entry in tag stack (only in some versions) 849a6c27c47SBram Moolenaar`:preserve` write all text to swap file {Vi: might also exit} 850a6c27c47SBram Moolenaar`:previous` same as `:Next` {Vi: only in some versions} 85125c9c680SBram Moolenaar`:print` print lines 85225c9c680SBram Moolenaar`:put` insert contents of register in the text 85325c9c680SBram Moolenaar`:quit` quit Vi 85425c9c680SBram Moolenaar`:read` read file into the text 855a6c27c47SBram Moolenaar`:recover` recover a file from a swap file {Vi: recovers in another way 856a6c27c47SBram Moolenaar and sends mail if there is something to recover} 85725c9c680SBram Moolenaar`:rewind` go to the first file in the argument list; no ++opt 85825c9c680SBram Moolenaar`:set` set option; but not `:set inv{option}`, `:set option&`, 85925c9c680SBram Moolenaar `:set all&`, `:set option+=value`, `:set option^=value` 86025c9c680SBram Moolenaar `:set option-=value` `:set option<` 86125c9c680SBram Moolenaar`:shell` escape to a shell 86268e6560bSBram Moolenaar`:source` read Vi or Ex commands from a file 86325c9c680SBram Moolenaar`:stop` suspend the editor or escape to a shell 86425c9c680SBram Moolenaar`:substitute` find and replace text; Vi: no '&', 'i', 's', 'r' or 'I' flag, 86525c9c680SBram Moolenaar confirm prompt only supports 'y' and 'n', no highlighting 86625c9c680SBram Moolenaar`:suspend` same as ":stop" 86725c9c680SBram Moolenaar`:t` same as ":copy" 86825c9c680SBram Moolenaar`:tag` jump to tag 86925c9c680SBram Moolenaar`:unabbreviate` remove abbreviation 87025c9c680SBram Moolenaar`:undo` undo last change {Vi: only one level} 87125c9c680SBram Moolenaar`:unmap` remove mapping 87225c9c680SBram Moolenaar`:vglobal` execute commands for not matching lines 87325c9c680SBram Moolenaar`:version` print version number and other info 87425c9c680SBram Moolenaar`:visual` same as ":edit", but turns off "Ex" mode 87525c9c680SBram Moolenaar`:wq` write to a file and quit Vi 87625c9c680SBram Moolenaar`:write` write to a file 87725c9c680SBram Moolenaar`:xit` write if buffer changed and quit Vi 87825c9c680SBram Moolenaar`:yank` yank lines into a register 87925c9c680SBram Moolenaar`:z` print some lines {not in all versions of Vi} 88025c9c680SBram Moolenaar`:!` filter lines or execute an external command 88125c9c680SBram Moolenaar`:"` comment 88225c9c680SBram Moolenaar`:#` same as ":number" 88325c9c680SBram Moolenaar`:*` execute contents of a register 88425c9c680SBram Moolenaar`:&` repeat last ":substitute" 88525c9c680SBram Moolenaar`:<` shift lines one 'shiftwidth' left 88625c9c680SBram Moolenaar`:=` print the cursor line number 88725c9c680SBram Moolenaar`:>` shift lines one 'shiftwidth' right 88825c9c680SBram Moolenaar`:@` execute contents of a register; but not `:@`; `:@@` only in 88925c9c680SBram Moolenaar some versions 8906c60f47fSBram Moolenaar 891a6c27c47SBram MoolenaarCommon for these commands is that Vi doesn't support the ++opt argument on 892a6c27c47SBram Moolenaar`:edit` and other commands that open a file. 893a6c27c47SBram Moolenaar 8946c60f47fSBram Moolenaar 8956c60f47fSBram MoolenaarThe following Normal mode commands are supported by Vi: ~ 8966c60f47fSBram Moolenaar 89768e6560bSBram Moolenaarnote: See the beginning of |normal-index| for the meaning of WORD, N, Nmove 89868e6560bSBram Moolenaarand etc in the description text. 89968e6560bSBram Moolenaar 90025c9c680SBram Moolenaar|CTRL-B| scroll N screens Backwards 90125c9c680SBram Moolenaar|CTRL-C| interrupt current (search) command 90225c9c680SBram Moolenaar|CTRL-D| scroll Down N lines (default: half a screen); Vim scrolls 90325c9c680SBram Moolenaar 'scroll' screen lines, Vi scrolls file lines; makes a 90425c9c680SBram Moolenaar difference when lines wrap 90525c9c680SBram Moolenaar|CTRL-E| scroll N lines upwards (N lines Extra) 90625c9c680SBram Moolenaar|CTRL-F| scroll N screens Forward 90725c9c680SBram Moolenaar|CTRL-G| display current file name and position 90825c9c680SBram Moolenaar|<BS>| same as "h" 90925c9c680SBram Moolenaar|CTRL-H| same as "h" 91025c9c680SBram Moolenaar|<NL>| same as "j" 91125c9c680SBram Moolenaar|CTRL-J| same as "j" 91225c9c680SBram Moolenaar|CTRL-L| redraw screen 91325c9c680SBram Moolenaar|<CR>| cursor to the first CHAR N lines lower 91425c9c680SBram Moolenaar|CTRL-M| same as <CR> 91525c9c680SBram Moolenaar|CTRL-N| same as "j" 91625c9c680SBram Moolenaar|CTRL-P| same as "k" 91725c9c680SBram Moolenaar|CTRL-R| in some Vi versions: same as CTRL-L 91825c9c680SBram Moolenaar|CTRL-T| jump to N older Tag in tag list 91968e6560bSBram Moolenaar|CTRL-U| N lines Upwards (default: half a screen) {Vi used file lines 92068e6560bSBram Moolenaar while Vim scrolls 'scroll' screen lines; makes a difference 92168e6560bSBram Moolenaar when lines wrap} 92225c9c680SBram Moolenaar|CTRL-Y| scroll N lines downwards 92325c9c680SBram Moolenaar|CTRL-Z| suspend program (or start new shell) 924a6c27c47SBram Moolenaar|CTRL-]| :ta to ident under cursor {Vi: identifier after the cursor} 925a6c27c47SBram Moolenaar|CTRL-^| edit alternate file {Vi: no count} 92625c9c680SBram Moolenaar|<Space>| same as "l" 92725c9c680SBram Moolenaar|!| filter Nmove text through the {filter} command 92825c9c680SBram Moolenaar|!!| filter N lines through the {filter} command 92925c9c680SBram Moolenaar" use register {a-zA-Z0-9.%#:-"} for next delete, yank or put 93025c9c680SBram Moolenaar (uppercase to append) ({.%#:} only work with put) 93125c9c680SBram Moolenaar|$| cursor to the end of Nth next line 93225c9c680SBram Moolenaar|%| find the next (curly/square) bracket on this line and go to 93325c9c680SBram Moolenaar its match, or go to matching comment bracket, or go to 93425c9c680SBram Moolenaar matching preprocessor directive (Vi: no count supported) 93525c9c680SBram Moolenaar|&| repeat last :s 93625c9c680SBram Moolenaar|'| jump to mark (Vi: only lowercase marks) 93725c9c680SBram Moolenaar|(| cursor N sentences backward 93825c9c680SBram Moolenaar|)| cursor N sentences forward 93925c9c680SBram Moolenaar|+| same as <CR> 94025c9c680SBram Moolenaar|,| repeat latest f, t, F or T in opposite direction N times 94125c9c680SBram Moolenaar|-| cursor to the first CHAR N lines higher 94225c9c680SBram Moolenaar|.| repeat last change with count replaced with N 94325c9c680SBram Moolenaar|/| search forward for the Nth occurrence of {pattern} 94425c9c680SBram Moolenaar|0| cursor to the first char of the line 94525c9c680SBram Moolenaar|:| start entering an Ex command 94625c9c680SBram Moolenaar|;| repeat latest f, t, F or T N times 94725c9c680SBram Moolenaar|<| shift Nmove lines one 'shiftwidth' leftwards 94825c9c680SBram Moolenaar|<<| shift N lines one 'shiftwidth' leftwards 94925c9c680SBram Moolenaar|=| filter Nmove lines through "indent" 95025c9c680SBram Moolenaar|==| filter N lines through "indent" 95125c9c680SBram Moolenaar|>| shift Nmove lines one 'shiftwidth' rightwards 95225c9c680SBram Moolenaar|>>| shift N lines one 'shiftwidth' rightwards 95325c9c680SBram Moolenaar|?| search backward for the Nth previous occurrence of {pattern} 95425c9c680SBram Moolenaar|@| execute the contents of register {a-z} N times 955a6c27c47SBram Moolenaar {Vi: only named registers} 95625c9c680SBram Moolenaar|@@| repeat the previous @{a-z} N times 95725c9c680SBram Moolenaar|A| append text after the end of the line N times 95825c9c680SBram Moolenaar|B| cursor N WORDS backward 95925c9c680SBram Moolenaar|C| change from the cursor position to the end of the line 96025c9c680SBram Moolenaar|D| delete the characters under the cursor until the end of the 96125c9c680SBram Moolenaar line and N-1 more lines [into register x]; synonym for "d$" 96225c9c680SBram Moolenaar|E| cursor forward to the end of WORD N 96325c9c680SBram Moolenaar|F| cursor to the Nth occurrence of {char} to the left 96425c9c680SBram Moolenaar|G| cursor to line N, default last line 96525c9c680SBram Moolenaar|H| cursor to line N from top of screen 96625c9c680SBram Moolenaar|I| insert text before the first CHAR on the line N times 96725c9c680SBram Moolenaar|J| Join N lines; default is 2 96825c9c680SBram Moolenaar|L| cursor to line N from bottom of screen 96925c9c680SBram Moolenaar|M| cursor to middle line of screen 97025c9c680SBram Moolenaar|N| repeat the latest '/' or '?' N times in opposite direction 97125c9c680SBram Moolenaar|O| begin a new line above the cursor and insert text, repeat N 972a6c27c47SBram Moolenaar times {Vi: blank [count] screen lines} 97325c9c680SBram Moolenaar|P| put the text [from register x] before the cursor N times 974a6c27c47SBram Moolenaar {Vi: no count} 97525c9c680SBram Moolenaar|Q| switch to "Ex" mode 97625c9c680SBram Moolenaar|R| enter replace mode: overtype existing characters, repeat the 97725c9c680SBram Moolenaar entered text N-1 times 97825c9c680SBram Moolenaar|S| delete N lines [into register x] and start insert; synonym for 97925c9c680SBram Moolenaar "cc". 98025c9c680SBram Moolenaar|T| cursor till after Nth occurrence of {char} to the left 98125c9c680SBram Moolenaar|U| undo all latest changes on one line 982a6c27c47SBram Moolenaar {Vi: while not moved off of the last modified line} 98325c9c680SBram Moolenaar|W| cursor N WORDS forward 98425c9c680SBram Moolenaar|X| delete N characters before the cursor [into register x] 98525c9c680SBram Moolenaar|Y| yank N lines [into register x]; synonym for "yy" 98625c9c680SBram Moolenaar|ZZ| store current file if modified, and exit 98725c9c680SBram Moolenaar|[[| cursor N sections backward 98825c9c680SBram Moolenaar|]]| cursor N sections forward 98925c9c680SBram Moolenaar|^| cursor to the first CHAR of the line 99025c9c680SBram Moolenaar|_| cursor to the first CHAR N - 1 lines lower 99125c9c680SBram Moolenaar|`| cursor to the mark {a-zA-Z0-9} 99225c9c680SBram Moolenaar|a| append text after the cursor N times 99325c9c680SBram Moolenaar|b| cursor N words backward 99425c9c680SBram Moolenaar|c| delete Nmove text [into register x] and start insert 99525c9c680SBram Moolenaar|cc| delete N lines [into register x] and start insert 99625c9c680SBram Moolenaar|d| delete Nmove text [into register x] 99725c9c680SBram Moolenaar|dd| delete N lines [into register x] 99825c9c680SBram Moolenaar|e| cursor forward to the end of word N 99925c9c680SBram Moolenaar|f| cursor to Nth occurrence of {char} to the right 100025c9c680SBram Moolenaar|h| cursor N chars to the left 100125c9c680SBram Moolenaar|i| insert text before the cursor N times 100225c9c680SBram Moolenaar|j| cursor N lines downward 100325c9c680SBram Moolenaar|k| cursor N lines upward 100425c9c680SBram Moolenaar|l| cursor N chars to the right 100525c9c680SBram Moolenaar|m| set mark {A-Za-z} at cursor position 100625c9c680SBram Moolenaar|n| repeat the latest '/' or '?' N times 100725c9c680SBram Moolenaar|o| begin a new line below the cursor and insert text 1008a6c27c47SBram Moolenaar {Vi: blank [count] screen lines} 100925c9c680SBram Moolenaar|p| put the text [from register x] after the cursor N times 1010a6c27c47SBram Moolenaar {Vi: no count} 1011a6c27c47SBram Moolenaar|r| replace N chars with {char} {Vi: CTRL-V <CR> still replaces 1012a6c27c47SBram Moolenaar with a line break, cannot replace something with a <CR>} 101325c9c680SBram Moolenaar|s| (substitute) delete N characters [into register x] and start 101425c9c680SBram Moolenaar insert 101525c9c680SBram Moolenaar|t| cursor till before Nth occurrence of {char} to the right 101625c9c680SBram Moolenaar|u| undo changes {Vi: only one level} 101725c9c680SBram Moolenaar|w| cursor N words forward 101825c9c680SBram Moolenaar|x| delete N characters under and after the cursor [into register 101925c9c680SBram Moolenaar x] 102025c9c680SBram Moolenaar|y| yank Nmove text [into register x] 102125c9c680SBram Moolenaar|yy| yank N lines [into register x] 102225c9c680SBram Moolenaar|z<CR>| current line to the top 102325c9c680SBram Moolenaar|z-| current line to the bottom 102425c9c680SBram Moolenaar|z+| cursor on line N 102525c9c680SBram Moolenaar|z^| cursor on line N 102625c9c680SBram Moolenaar|{| cursor N paragraphs backward 102725c9c680SBram Moolenaar| cursor to column N 102825c9c680SBram Moolenaar|}| cursor N paragraphs forward 102925c9c680SBram Moolenaar|~| switch case of N characters under the cursor; Vim: depends on 1030a6c27c47SBram Moolenaar 'tildeop' {Vi: no count, no 'tildeop'} 103125c9c680SBram Moolenaar|<Del>| same as "x" 103225c9c680SBram Moolenaar 103325c9c680SBram Moolenaar 103425c9c680SBram MoolenaarThe following commands are supported in Insert mode by Vi: ~ 103525c9c680SBram Moolenaar 103625c9c680SBram MoolenaarCTRL-@ insert previously inserted text and stop insert 1037a6c27c47SBram Moolenaar {Vi: only when typed as first char, only up to 128 chars} 103825c9c680SBram MoolenaarCTRL-C quit insert mode, without checking for abbreviation, unless 103925c9c680SBram Moolenaar 'insertmode' set. 104025c9c680SBram MoolenaarCTRL-D delete one shiftwidth of indent in the current line 1041a6c27c47SBram Moolenaar {Vi: CTRL-D works only when used after autoindent} 1042a6c27c47SBram Moolenaar<BS> delete character before the cursor {Vi: does not delete 1043a6c27c47SBram Moolenaar autoindents, does not cross lines, does not delete past start 1044a6c27c47SBram Moolenaar position of insert} 104525c9c680SBram MoolenaarCTRL-H same as <BS> 104625c9c680SBram Moolenaar<Tab> insert a <Tab> character 104725c9c680SBram MoolenaarCTRL-I same as <Tab> 104825c9c680SBram Moolenaar<NL> same as <CR> 104925c9c680SBram MoolenaarCTRL-J same as <CR> 105025c9c680SBram Moolenaar<CR> begin new line 105125c9c680SBram MoolenaarCTRL-M same as <CR> 1052a6c27c47SBram MoolenaarCTRL-T insert one shiftwidth of indent in current line {Vi: only when 1053a6c27c47SBram Moolenaar in indent} 1054a6c27c47SBram MoolenaarCTRL-V {char} insert next non-digit literally {Vi: no decimal byte entry} 105525c9c680SBram MoolenaarCTRL-W delete word before the cursor 105668e6560bSBram MoolenaarCTRL-Z when 'insertmode' set: suspend Vi 105725c9c680SBram Moolenaar<Esc> end insert mode (unless 'insertmode' set) 105825c9c680SBram MoolenaarCTRL-[ same as <Esc> 105925c9c680SBram Moolenaar0 CTRL-D delete all indent in the current line 106025c9c680SBram Moolenaar^ CTRL-D delete all indent in the current line, restore it in the next 106125c9c680SBram Moolenaar line 106225c9c680SBram Moolenaar<Del> delete character under the cursor 10636c60f47fSBram Moolenaar 10646c60f47fSBram Moolenaar 10656c60f47fSBram MoolenaarThe following options are supported by Vi: ~ 10666c60f47fSBram Moolenaar 10676c60f47fSBram Moolenaar'autoindent' 'ai' take indent for new line from previous line 1068a6c27c47SBram Moolenaar {Vi does this slightly differently: After the 1069a6c27c47SBram Moolenaar indent is deleted when typing <Esc> or <CR>, the 1070a6c27c47SBram Moolenaar cursor position when moving up or down is after 1071a6c27c47SBram Moolenaar the deleted indent; Vi puts the cursor somewhere 1072a6c27c47SBram Moolenaar in the deleted indent}. 10736c60f47fSBram Moolenaar'autowrite' 'aw' automatically write file if changed 10746c60f47fSBram Moolenaar'directory' 'dir' list of directory names for the swap file 1075a6c27c47SBram Moolenaar {Vi: directory to put temp file in, defaults to 1076a6c27c47SBram Moolenaar "/tmp"} 10776c60f47fSBram Moolenaar'edcompatible' 'ed' toggle flags of ":substitute" command 10786c60f47fSBram Moolenaar'errorbells' 'eb' ring the bell for error messages 10796c60f47fSBram Moolenaar'ignorecase' 'ic' ignore case in search patterns 10806c60f47fSBram Moolenaar'lines' number of lines in the display 1081a6c27c47SBram Moolenaar'lisp' automatic indenting for Lisp {Vi: Does it a little 1082a6c27c47SBram Moolenaar bit differently} 10836c60f47fSBram Moolenaar'list' show <Tab> and <EOL> 10846c60f47fSBram Moolenaar'magic' changes special characters in search patterns 10856c60f47fSBram Moolenaar'modeline' 'ml' recognize 'modelines' at start or end of file 10866c60f47fSBram Moolenaar {called modelines in some Vi versions} 10876c60f47fSBram Moolenaar'number' 'nu' print the line number in front of each line 10886c60f47fSBram Moolenaar'paragraphs' 'para' nroff macros that separate paragraphs 10896c60f47fSBram Moolenaar'prompt' 'prompt' enable prompt in Ex mode 10906c60f47fSBram Moolenaar'readonly' 'ro' disallow writing the buffer {Vim sets 'readonly' 10916c60f47fSBram Moolenaar when editing a file with `:view`} 10926c60f47fSBram Moolenaar'remap' allow mappings to work recursively 10936c60f47fSBram Moolenaar'report' threshold for reporting nr. of lines changed 10946c60f47fSBram Moolenaar'scroll' 'scr' lines to scroll with CTRL-U and CTRL-D 10956c60f47fSBram Moolenaar'sections' 'sect' nroff macros that separate sections 10966c60f47fSBram Moolenaar'shell' 'sh' name of shell to use for external commands 10976c60f47fSBram Moolenaar'shiftwidth' 'sw' number of spaces to use for (auto)indent step 10986c60f47fSBram Moolenaar'showmatch' 'sm' briefly jump to matching bracket if insert one 10996c60f47fSBram Moolenaar'showmode' 'smd' message on status line to show current mode 11006c60f47fSBram Moolenaar'tabstop' 'ts' number of spaces that <Tab> in file uses 11016c60f47fSBram Moolenaar'taglength' 'tl' number of significant characters for a tag 11026c60f47fSBram Moolenaar'tags' 'tag' list of file names used by the tag command 1103a6c27c47SBram Moolenaar {Vi: default is "tags /usr/lib/tags"} 11046c60f47fSBram Moolenaar'tagstack' 'tgst' push tags onto the tag stack {not in all versions 11056c60f47fSBram Moolenaar of Vi} 11066c60f47fSBram Moolenaar'term' name of the terminal 11076c60f47fSBram Moolenaar'terse' shorten some messages 11086c60f47fSBram Moolenaar'timeout' 'to' time out on mappings and key codes 110925c9c680SBram Moolenaar'timeoutlen' 'tm' time for 'timeout' {only in some Vi versions} 11106c60f47fSBram Moolenaar'ttytype' 'tty' alias for 'term' 11116c60f47fSBram Moolenaar'verbose' 'vbs' give informative messages {only in some Vi 11126c60f47fSBram Moolenaar versions as a boolean option} 11136c60f47fSBram Moolenaar'warn' warn for shell command when buffer was changed 11146c60f47fSBram Moolenaar'window' 'wi' nr of lines to scroll for CTRL-F and CTRL-B 111525c9c680SBram Moolenaar {Vi also uses the option to specify the number of 111625c9c680SBram Moolenaar displayed lines} 11176c60f47fSBram Moolenaar'wrapmargin' 'wm' chars from the right where wrapping starts 1118a6c27c47SBram Moolenaar {Vi: works differently and less usefully} 11196c60f47fSBram Moolenaar'wrapscan' 'ws' searches wrap around the end of the file 11206c60f47fSBram Moolenaar'writeany' 'wa' write to file with no need for "!" override 11216c60f47fSBram Moolenaar 11226c60f47fSBram MoolenaarAlso see |missing-options|. 11236c60f47fSBram Moolenaar 11246c60f47fSBram Moolenaar============================================================================== 11256c60f47fSBram Moolenaar7. Command-line arguments *cmdline-arguments* 1126071d4279SBram Moolenaar 1127071d4279SBram MoolenaarDifferent versions of Vi have different command-line arguments. This can be 1128071d4279SBram Moolenaarconfusing. To help you, this section gives an overview of the differences. 1129071d4279SBram Moolenaar 1130071d4279SBram MoolenaarFive variants of Vi will be considered here: 1131071d4279SBram Moolenaar Elvis Elvis version 2.1b 1132071d4279SBram Moolenaar Nvi Nvi version 1.79 1133071d4279SBram Moolenaar Posix Posix 1003.2 1134071d4279SBram Moolenaar Vi Vi version 3.7 (for Sun 4.1.x) 1135071d4279SBram Moolenaar Vile Vile version 7.4 (incomplete) 1136071d4279SBram Moolenaar Vim Vim version 5.2 1137071d4279SBram Moolenaar 1138071d4279SBram MoolenaarOnly Vim is able to accept options in between and after the file names. 1139071d4279SBram Moolenaar 1140071d4279SBram Moolenaar+{command} Elvis, Nvi, Posix, Vi, Vim: Same as "-c {command}". 1141071d4279SBram Moolenaar 1142071d4279SBram Moolenaar- Nvi, Posix, Vi: Run Ex in batch mode. 1143071d4279SBram Moolenaar Vim: Read file from stdin (use -s for batch mode). 1144071d4279SBram Moolenaar 1145071d4279SBram Moolenaar-- Vim: End of options, only file names are following. 1146071d4279SBram Moolenaar 1147071d4279SBram Moolenaar--cmd {command} Vim: execute {command} before sourcing vimrc files. 1148071d4279SBram Moolenaar 1149071d4279SBram Moolenaar--echo-wid Vim: GTK+ echoes the Window ID on stdout 1150071d4279SBram Moolenaar 1151071d4279SBram Moolenaar--help Vim: show help message and exit. 1152071d4279SBram Moolenaar 1153071d4279SBram Moolenaar--literal Vim: take file names literally, don't expand wildcards. 1154071d4279SBram Moolenaar 1155071d4279SBram Moolenaar--nofork Vim: same as |-f| 1156071d4279SBram Moolenaar 1157071d4279SBram Moolenaar--noplugin[s] Vim: Skip loading plugins. 1158071d4279SBram Moolenaar 1159071d4279SBram Moolenaar--remote Vim: edit the files in another Vim server 1160071d4279SBram Moolenaar 1161071d4279SBram Moolenaar--remote-expr {expr} Vim: evaluate {expr} in another Vim server 1162071d4279SBram Moolenaar 1163071d4279SBram Moolenaar--remote-send {keys} Vim: send {keys} to a Vim server and exit 1164071d4279SBram Moolenaar 1165071d4279SBram Moolenaar--remote-silent {file} Vim: edit the files in another Vim server if possible 1166071d4279SBram Moolenaar 1167071d4279SBram Moolenaar--remote-wait Vim: edit the files in another Vim server and wait for it 1168071d4279SBram Moolenaar 1169071d4279SBram Moolenaar--remote-wait-silent Vim: like --remote-wait, no complaints if not possible 1170071d4279SBram Moolenaar 1171071d4279SBram Moolenaar--role {role} Vim: GTK+ 2: set role of main window 1172071d4279SBram Moolenaar 1173071d4279SBram Moolenaar--serverlist Vim: Output a list of Vim servers and exit 1174071d4279SBram Moolenaar 1175071d4279SBram Moolenaar--servername {name} Vim: Specify Vim server name 1176071d4279SBram Moolenaar 1177071d4279SBram Moolenaar--socketid {id} Vim: GTK window socket to run Vim in 1178071d4279SBram Moolenaar 117978e1762cSBram Moolenaar--windowid {id} Vim: Win32 window ID to run Vim in 118078e1762cSBram Moolenaar 1181071d4279SBram Moolenaar--version Vim: show version message and exit. 1182071d4279SBram Moolenaar 1183071d4279SBram Moolenaar-? Vile: print usage summary and exit. 1184071d4279SBram Moolenaar 1185071d4279SBram Moolenaar-a Elvis: Load all specified file names into a window (use -o for 1186071d4279SBram Moolenaar Vim). 1187071d4279SBram Moolenaar 1188071d4279SBram Moolenaar-A Vim: Start in Arabic mode (when compiled with Arabic). 1189071d4279SBram Moolenaar 1190071d4279SBram Moolenaar-b {blksize} Elvis: Use {blksize} blocksize for the session file. 1191071d4279SBram Moolenaar-b Vim: set 'binary' mode. 1192071d4279SBram Moolenaar 1193071d4279SBram Moolenaar-C Vim: Compatible mode. 1194071d4279SBram Moolenaar 1195071d4279SBram Moolenaar-c {command} Elvis, Nvi, Posix, Vim: run {command} as an Ex command after 1196071d4279SBram Moolenaar loading the edit buffer. 1197071d4279SBram Moolenaar Vim: allow up to 10 "-c" arguments 1198071d4279SBram Moolenaar 1199071d4279SBram Moolenaar-d {device} Vim: Use {device} for I/O (Amiga only). {only when compiled 1200071d4279SBram Moolenaar without the |+diff| feature} 1201071d4279SBram Moolenaar-d Vim: start with 'diff' set. |vimdiff| 1202071d4279SBram Moolenaar 1203071d4279SBram Moolenaar-dev {device} Vim: Use {device} for I/O (Amiga only). 1204071d4279SBram Moolenaar 1205071d4279SBram Moolenaar-D Vim: debug mode. 1206071d4279SBram Moolenaar 1207071d4279SBram Moolenaar-e Elvis, Nvi, Vim: Start in Ex mode, as if the executable is 1208071d4279SBram Moolenaar called "ex". 1209071d4279SBram Moolenaar 1210071d4279SBram Moolenaar-E Vim: Start in improved Ex mode |gQ|, like "exim". 1211071d4279SBram Moolenaar 1212071d4279SBram Moolenaar-f Vim: Run GUI in foreground (Amiga: don't open new window). 1213071d4279SBram Moolenaar-f {session} Elvis: Use {session} as the session file. 1214071d4279SBram Moolenaar 1215071d4279SBram Moolenaar-F Vim: Start in Farsi mode (when compiled with Farsi). 1216071d4279SBram Moolenaar Nvi: Fast start, don't read the entire file when editing 1217071d4279SBram Moolenaar starts. 1218071d4279SBram Moolenaar 1219071d4279SBram Moolenaar-G {gui} Elvis: Use the {gui} as user interface. 1220071d4279SBram Moolenaar 1221071d4279SBram Moolenaar-g Vim: Start GUI. 1222071d4279SBram Moolenaar-g N Vile: start editing at line N 1223071d4279SBram Moolenaar 1224071d4279SBram Moolenaar-h Vim: Give help message. 1225071d4279SBram Moolenaar Vile: edit the help file 1226071d4279SBram Moolenaar 1227071d4279SBram Moolenaar-H Vim: start Hebrew mode (when compiled with it). 1228071d4279SBram Moolenaar 1229071d4279SBram Moolenaar-i Elvis: Start each window in Insert mode. 1230071d4279SBram Moolenaar-i {viminfo} Vim: Use {viminfo} for viminfo file. 1231071d4279SBram Moolenaar 123225c9c680SBram Moolenaar-L Vim: Same as "-r" {only in some versions of Vi: "List 123325c9c680SBram Moolenaar recoverable edit sessions"}. 1234071d4279SBram Moolenaar 1235071d4279SBram Moolenaar-l Nvi, Vi, Vim: Set 'lisp' and 'showmatch' options. 1236071d4279SBram Moolenaar 1237071d4279SBram Moolenaar-m Vim: Modifications not allowed to be written, resets 'write' 1238071d4279SBram Moolenaar option. 1239071d4279SBram Moolenaar 1240071d4279SBram Moolenaar-M Vim: Modifications not allowed, resets 'modifiable' and the 1241071d4279SBram Moolenaar 'write' option. 1242071d4279SBram Moolenaar 1243071d4279SBram Moolenaar-N Vim: No-compatible mode. 1244071d4279SBram Moolenaar 1245071d4279SBram Moolenaar-n Vim: No swap file used. 1246071d4279SBram Moolenaar 1247071d4279SBram Moolenaar-nb[args] Vim: open a NetBeans interface connection 1248071d4279SBram Moolenaar 1249071d4279SBram Moolenaar-O[N] Vim: Like -o, but use vertically split windows. 1250071d4279SBram Moolenaar 1251071d4279SBram Moolenaar-o[N] Vim: Open [N] windows, or one for each file. 1252071d4279SBram Moolenaar 125318144c84SBram Moolenaar-p[N] Vim: Open [N] tab pages, or one for each file. 125418144c84SBram Moolenaar 1255071d4279SBram Moolenaar-P {parent-title} Win32 Vim: open Vim inside a parent application window 1256071d4279SBram Moolenaar 1257071d4279SBram Moolenaar-q {name} Vim: Use {name} for quickfix error file. 1258071d4279SBram Moolenaar-q{name} Vim: Idem. 1259071d4279SBram Moolenaar 1260071d4279SBram Moolenaar-R Elvis, Nvi, Posix, Vile, Vim: Set the 'readonly' option. 1261071d4279SBram Moolenaar 1262071d4279SBram Moolenaar-r Elvis, Nvi, Posix, Vi, Vim: Recovery mode. 1263071d4279SBram Moolenaar 1264071d4279SBram Moolenaar-S Nvi: Set 'secure' option. 1265071d4279SBram Moolenaar-S {script} Vim: source script after starting up. 1266071d4279SBram Moolenaar 1267071d4279SBram Moolenaar-s Nvi, Posix, Vim: Same as "-" (silent mode), when in Ex mode. 1268071d4279SBram Moolenaar Elvis: Sets the 'safer' option. 1269071d4279SBram Moolenaar-s {scriptin} Vim: Read from script file {scriptin}; only when not in Ex 1270071d4279SBram Moolenaar mode. 1271071d4279SBram Moolenaar-s {pattern} Vile: search for {pattern} 1272071d4279SBram Moolenaar 1273071d4279SBram Moolenaar-t {tag} Elvis, Nvi, Posix, Vi, Vim: Edit the file containing {tag}. 1274071d4279SBram Moolenaar-t{tag} Vim: Idem. 1275071d4279SBram Moolenaar 1276071d4279SBram Moolenaar-T {term} Vim: Set terminal name to {term}. 1277071d4279SBram Moolenaar 1278071d4279SBram Moolenaar-u {vimrc} Vim: Read initializations from {vimrc} file. 1279071d4279SBram Moolenaar 1280071d4279SBram Moolenaar-U {gvimrc} Vim: Read GUI initializations from {gvimrc} file. 1281071d4279SBram Moolenaar 1282071d4279SBram Moolenaar-v Nvi, Posix, Vi, Vim: Begin in Normal mode (visual mode, in Vi 1283071d4279SBram Moolenaar terms). 1284071d4279SBram Moolenaar Vile: View mode, no changes possible. 1285071d4279SBram Moolenaar 1286071d4279SBram Moolenaar-V Elvis, Vim: Verbose mode. 1287071d4279SBram Moolenaar-V{nr} Vim: Verbose mode with specified level. 1288071d4279SBram Moolenaar 1289071d4279SBram Moolenaar-w {size} Elvis, Posix, Nvi, Vi, Vim: Set value of 'window' to {size}. 1290071d4279SBram Moolenaar-w{size} Nvi, Vi: Same as "-w {size}". 1291071d4279SBram Moolenaar-w {name} Vim: Write to script file {name} (must start with non-digit). 1292071d4279SBram Moolenaar 1293071d4279SBram Moolenaar-W {name} Vim: Append to script file {name}. 1294071d4279SBram Moolenaar 1295071d4279SBram Moolenaar-x Vi, Vim: Ask for encryption key. See |encryption|. 1296071d4279SBram Moolenaar 1297071d4279SBram Moolenaar-X Vim: Don't connect to the X server. 1298071d4279SBram Moolenaar 1299071d4279SBram Moolenaar-y Vim: Start in easy mode, like |evim|. 1300071d4279SBram Moolenaar 1301071d4279SBram Moolenaar-Z Vim: restricted mode 1302071d4279SBram Moolenaar 1303071d4279SBram Moolenaar@{cmdfile} Vile: use {cmdfile} as startup file. 1304071d4279SBram Moolenaar 1305f97ca8f0SBram Moolenaar============================================================================== 13066c60f47fSBram Moolenaar8. POSIX compliance *posix* *posix-compliance* 1307f97ca8f0SBram Moolenaar 1308dd2a3cdaSBram MoolenaarIn 2005 the POSIX test suite was run to check the compatibility of Vim. Most 13094399ef47SBram Moolenaarof the test was executed properly. There are the few things where Vim 13106bdcfc08SBram Moolenaaris not POSIX compliant, even when run in Vi compatibility mode. 131138a55639SBram Moolenaar *$VIM_POSIX* 13124399ef47SBram MoolenaarSet the $VIM_POSIX environment variable to have 'cpoptions' include the POSIX 13134399ef47SBram Moolenaarflags when Vim starts up. This makes Vim run as POSIX as it can. That's 13146bdcfc08SBram Moolenaara bit different from being Vi compatible. 13154399ef47SBram Moolenaar 1316574ee7bcSBram MoolenaarYou can find the Posix specification for Vi here: 1317574ee7bcSBram Moolenaarhttps://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html 1318574ee7bcSBram MoolenaarAnd the related Ex specification: 1319574ee7bcSBram Moolenaarhttps://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex.html 1320574ee7bcSBram Moolenaar 13214399ef47SBram MoolenaarThis is where Vim does not behave as POSIX specifies and why: 13224399ef47SBram Moolenaar 1323f97ca8f0SBram Moolenaar *posix-screen-size* 13244399ef47SBram Moolenaar The $COLUMNS and $LINES environment variables are ignored by Vim if 13254399ef47SBram Moolenaar the size can be obtained from the terminal in a more reliable way. 13264399ef47SBram Moolenaar Add the '|' flag to 'cpoptions' to have $COLUMNS and $LINES overrule 13274399ef47SBram Moolenaar sizes obtained in another way. 1328f97ca8f0SBram Moolenaar 13294399ef47SBram Moolenaar The "{" and "}" commands don't stop at a "{" in the original Vi, but 13304399ef47SBram Moolenaar POSIX specifies it does. Add the '{' flag to 'cpoptions' if you want 13314399ef47SBram Moolenaar it the POSIX way. 13324399ef47SBram Moolenaar 13334399ef47SBram Moolenaar The "D", "o" and "O" commands accept a count. Also when repeated. 13344399ef47SBram Moolenaar Add the '#' flag to 'cpoptions' if you want to ignore the count. 1335f97ca8f0SBram Moolenaar 13366bdcfc08SBram Moolenaar The ":cd" command fails if the current buffer is modified when the '.' 13376bdcfc08SBram Moolenaar flag is present in 'cpoptions'. 13386bdcfc08SBram Moolenaar 13396bdcfc08SBram Moolenaar There is no ATTENTION message, the "A" flag is added to 'shortmess'. 13406bdcfc08SBram Moolenaar 13416bdcfc08SBram MoolenaarThese are remarks about running the POSIX test suite: 13426bdcfc08SBram Moolenaar- vi test 33 sometimes fails for unknown reasons 13436bdcfc08SBram Moolenaar- vi test 250 fails; behavior will be changed in a new revision 13446bdcfc08SBram Moolenaar http://www.opengroup.org/austin/mailarchives/ag-review/msg01710.html 1345483c5d80SBram Moolenaar (link no longer works, perhaps it's now: 1346483c5d80SBram Moolenaar https://www.opengroup.org/sophocles/show_mail.tpl?CALLER=show_archive.tpl&source=L&listname=austin-review-l&id=1711) 13476bdcfc08SBram Moolenaar- vi test 310 fails; exit code non-zero when any error occurred? 13486bdcfc08SBram Moolenaar- ex test 24 fails because test is wrong. Changed between SUSv2 and SUSv3. 13496bdcfc08SBram Moolenaar- ex tests 47, 48, 49, 72, 73 fail because .exrc file isn't read in silent 13506bdcfc08SBram Moolenaar mode and $EXINIT isn't used. 13516bdcfc08SBram Moolenaar- ex tests 76, 78 fail because echo is used instead of printf. (fixed) 13526bdcfc08SBram Moolenaar Also: problem with \s not changed to space. 13536bdcfc08SBram Moolenaar- ex test 355 fails because 'window' isn't used for "30z". 13546bdcfc08SBram Moolenaar- ex test 368 fails because shell command isn't echoed in silent mode. 13556bdcfc08SBram Moolenaar- ex test 394 fails because "=" command output isn't visible in silent mode. 13566bdcfc08SBram Moolenaar- ex test 411 fails because test file is wrong, contains stray ':'. 13576bdcfc08SBram Moolenaar- ex test 475 and 476 fail because reprint output isn't visible in silent mode. 13586bdcfc08SBram Moolenaar- ex test 480 and 481 fail because the tags file has spaces instead of a tab. 13596bdcfc08SBram Moolenaar- ex test 502 fails because .exrc isn't read in silent mode. 13606bdcfc08SBram Moolenaar- ex test 509 fails because .exrc isn't read in silent mode. and exit code is 13616bdcfc08SBram Moolenaar 1 instead of 2. 13626bdcfc08SBram Moolenaar- ex test 534 fails because .exrc isn't read in silent mode. 13636bdcfc08SBram Moolenaar 1364f97ca8f0SBram Moolenaar 1365d473c8c1SBram Moolenaar vim:tw=78:ts=8:noet:ft=help:norl: 1366