*vim_40.txt* For Vim version 4.5. Last modification: 1996 Sep 1 Welcome to Vim Version 4.0! This document lists the differences between Vim 3.0 and Vim 4.0. See |vim_diff.txt| for a short overview. Although 4.0 is mentioned here, this is also for version 4.1, 4.2, etc.. CONTENTS: VERSION WARNING MESSAGE |version_warning| INCOMPATIBLE CHANGES |Incompatible_changes| 'backup' option default changed |backup_changed| Extension for backup file changed |backup_extension| Structure of swap file changed |swapfile_changed| "-w scriptout" argument changed |scriptout_changed| Backspace and Delete keys |backspace_delete| Escape for | changed |escape_bar| Key codes changed |key_codes_changed| Terminal options changed |termcap_changed| 'errorformat' option changed |errorformat_changed| 'graphic' option gone |graphic_option_gone| 'yankendofline' option gone |ye_option_gone| 'icon' and 'title' default value changed |icon_changed| 'highlight' option changed |highlight_changed| 'tildeop' and 'weirdinvert' short names changed |short_name_changed| Use of "v", "V" and "CTRL-V" in Visual mode |use_visual_cmds| CTRL-B in Insert mode removed |toggle_revins| Q command changed to "gq" |Q_renamed| NEW AND IMPROVED FEATURES |new_features| New on-line help system |new_help| Tag support improved |new_tags| Command-line editing improvements |new_commandline| Improved indenting for C programs |new_cindent| Searching for words in include files |new_include| Word completion in Insert mode |new_complete| Automatic commands |new_autocmd| Options |new_options| Support for editing one-line paragraphs |new_para| Usage of key names |new_keys| Viminfo |new_viminfo| Compilation improvements |compilation| Improved (error) messages |new_msg| Swap file |new_swapfile| Mouse support |new_mouse| Graphical User Interface (GUI) |new_gui| Support for Windows NT and Windows 95 |new_win32| Support for OS/2 |new_os2| Support for MiNT |new_mint| Ex mode commands added |new_ex| Miscellaneous |new_misc| VI COMPATIBILITY IMPROVEMENTS |vi_compat| BUG FIXES |bug_fixes| VERSION WARNING MESSAGE *version* ======================= *version_warning* If you got the message No ":version 4.0" command found in any .vimrc when you started Vim, you should add this line to your vimrc: version 4.0 |:version| But read the information below first! INCOMPATIBLE CHANGES *Incompatible_changes* ==================== This section is important for everybody upgrading from 3.0 to 4.0. Read it carefully to avoid unexpected problems. 'backup' option default changed *backup_changed* ------------------------------- The default value for 'backup' used to be on. This resulted in a backup file being made when the original file was overwritten. Now the default for 'backup' is off. As soon as the writing of the file has succesfully finished, the backup file is deleted. If you want to keep the backup file, set 'backup' on in your vimrc. The reason for this change is that many people complained that leaving a backup file behind is not Vi-compatible. |'backup'| Extension for backup file changed *backup_extension* --------------------------------- The extension for the backup file used to be ".bak". Since other programs also use this extension and some users make copies with this extension, it was changed to the less obvious "~". Another advantage is that this takes less space, which is useful when working on a system with short file names. For example, on MS-DOS the backup files for "longfile.c" and "longfile.h" would both become "longfile.bak"; now they will be "longfile.c~" and "longfile.h~". If you prefer to use ".bak", you can set the 'backupext' option: :set bex=.bak |'backupext'| Structure of swap file changed *swapfile_changed* ------------------------------ The contents of the swap file were extended with several parameters. Vim stores the user name and other information about the edited file to make recovery more easy and to be able to know where the swap file comes from. The first part of the swap file can now be understood on a machine with a different byte order or sizeof(int). When you try to recover a file on such a machine, you will get an error message that this is not possible. Because of this change, swap files cannot be exchanged between 3.0 and 4.0. If you have a swap file from a crashed session with 3.0, use Vim 3.0 to recover the file---don't use 4.0. |swap_file| "-w scriptout" argument changed *scriptout_changed* ------------------------------- "vim -w scriptout" used to append to the scriptout file. Since this was illogical, it now creates a new file. An existing file is not overwritten (to avoid destroying an existing file for those who rely on the appending). |-w| Backspace and Delete keys *backspace_delete* ------------------------- In 3.0 both the delete key and the backspace key worked as a backspace in insert mode; they deleted the character to the left of the cursor. In 4.0 the delete key has a new function: it deletes the character under the cursor, just like it does on the command line. If the cursor is after the end of the line and 'bs' is set, two lines are joined. || |i_| In 3.0 the backspace key was always defined as CTRL-H and delete as CTRL-?. In 4.0 the code for the backspace and delete key is obtained from termcap or termlib, and adjusted for the "stty erase" value on Unix. This helps people who define the erase character according to the keyboard they are working on. || |i_| If you prefer backspace and delete in Insert mode to have the old behaviour, put this line in your vimrc: inoremap ^? ^H And you may also want to add these, to fix the values for and : set t_kb=^H set t_kD=^? (Enter ^H with CTRL-V CTRL-H and ^? with CTRL-V CTRL-? or .) If the value for t_kb is correct, but the t_kD value is not, use the ":fixdel" command. It will set t_kD according to the value of t_kb. This is useful if you are using several different terminals. |:fixdel| When ^H is not recognized as or , it is used like a backspace. Escape for | changed *escape_bar* -------------------- When the 'b' flag is present in 'cpoptions', the backslash cannot be used to escape '|' in mapping and abbreviate commands, only CTRL-V can. This is Vi-compatible. If you work in Vi-compatible mode and had used "\|" to include a bar in a mapping, this needs to be replaced by "^V|". See |:bar|. Key codes changed *key_codes_changed* ----------------- The internal representation of key codes has changed dramatically. In 3.0 a one-byte code was used to represent a key. This caused problems with different characters sets that also used these codes. In 4.0 a three-byte code is used that cannot be confused with a character. |key_notation| If you have used the single-byte key codes in your vimrc for mappings, you will have to replace them with the 4.0 codes. Instead of using the three-byte code directly, you should use the symbolic representation for this in <>. See the table below. The table also lists the old name, as it was used in the 3.0 documentation. The key names in <> can be used in mappings directly. This makes it possible to copy/paste examples or type them literally. The <> notation has been introduced for this |<>|. The 'B' and '<' flags must not be present in 'cpoptions' to enable this to work |'cpoptions'|. old name new name old code old MS-DOS code hex dec hex dec 0x80 128 0xb0 176 0x81 129 0xb1 177 0x82 130 0xb2 178 0x83 131 0xb3 179 0x84 132 0xb4 180 0x85 133 0xb5 181 0x86 134 0xb6 182 0x87 135 0xb7 183 0x88 136 0xb8 184 0x89 137 0xb9 185 0x8a 138 0xba 186 0x8b 139 0xbb 187 0x8c 140 0xbc 188 0x8d 141 0xbd 189 0x8e 142 0xbe 190 0x8f 143 0xbf 191 0x90 144 0xc0 192 0x91 145 0xc1 193 0x92 146 0xc2 194 0x93 147 0xc3 195 0x94 148 0xc4 196 0x95 149 0xc5 197 0x96 150 0xc6 198 0x97 151 0xc7 199 0x98 152 0xc8 200 0x99 153 0xc9 201 0x9a 154 0xca 202 0x9b 155 0xcb 203 0x9c 156 0xcc 204 0x9d 157 0xcd 205 (not used) 0x9e 158 0xce 206 (not used) 0x9f 159 0xcf 207 Terminal options changed *termcap_changed* ------------------------ The names of the terminal options have been changed to match the termcap names of these options. All terminal options now have the name t_xx, where xx is the termcap name. Normally these options are not used, unless you have a termcap entry that is wrong or incomplete, or you have set the highlight options to a different value. |terminal_options| Note that for some keys there is no termcap name. Use the <> type of name instead, which is a good idea anyway. Note that "t_ti" has become "t_mr" (invert/reverse output) and "t_ts" has become "t_ti" (init terminal mode). Be careful when you use "t_ti"! old name new name meaning t_cdl t_DL delete number of lines *t_cdl* t_ci t_vi cursor invisible *t_ci* t_cil t_AL insert number of lines *t_cil* t_cm t_cm move cursor t_cri t_RI cursor number of chars right *t_cri* t_cv t_ve cursor visible *t_cv* t_cvv t_vs cursor very visible *t_cvv* t_dl t_dl delete line t_cs t_cs scroll region t_ed t_cl clear display *t_ed* t_el t_ce clear line *t_el* t_il t_al insert line *t_il* t_da display may be retained above the screen t_db display may be retained below the screen t_ke t_ke put terminal out of keypad transmit mode t_ks t_ks put terminal in keypad transmit mode t_ms t_ms save to move cursor in highlight mode t_se t_se normal mode (undo t_so) t_so t_so shift out (standout) mode t_ti t_mr reverse highlight t_tb t_md bold mode *t_tb* t_tp t_me highlight end *t_tp* t_sr t_sr scroll reverse t_te t_te out of termcap mode t_ts t_ti into termcap mode *t_ts* t_vb t_vb visual bell t_csc t_CS cursor is relative to scroll region *t_csc* t_ku t_ku arrow up t_kd t_kd arrow down t_kr t_kr arrow right t_kl t_kl arrow left t_sku shifted arrow up *t_sku* t_skd shifted arrow down *t_skd* t_skr t_%i shifted arrow right *t_skr* t_skl t_#4 shifted arrow left *t_skl* t_f1 t_k1 function key 1 *t_f1* t_f2 t_k2 function key 2 *t_f2* t_f3 t_k3 function key 3 *t_f3* t_f4 t_k4 function key 4 *t_f4* t_f5 t_k5 function key 5 *t_f5* t_f6 t_k6 function key 6 *t_f6* t_f7 t_k7 function key 7 *t_f7* t_f8 t_k8 function key 8 *t_f8* t_f9 t_k9 function key 9 *t_f9* t_f10 t_k; function key 10 *t_f10* t_sf1 shifted function key 1 *t_sf1* t_sf2 shifted function key 2 *t_sf2* t_sf3 shifted function key 3 *t_sf3* t_sf4 shifted function key 4 *t_sf4* t_sf5 shifted function key 5 *t_sf5* t_sf6 shifted function key 6 *t_sf6* t_sf7 shifted function key 7 *t_sf7* t_sf8 shifted function key 8 *t_sf8* t_sf9 shifted function key 9 *t_sf9* t_sf10 shifted function key 10 *t_sf10* t_help t_%1 help key *t_help* t_undo t_&8 undo key *t_undo* 'errorformat' option changed *errorformat_changed* ---------------------------- 'errorformat' can now contain several formats, separated by commas. The first format that matches is used. The default values have been adjusted to catch the most common formats. |errorformat| If you have a format that contains a comma, it needs to be preceded with a backslash. Type two backslashes, because the ":set" command will eat one. 'graphic' option gone *graphic_option_gone* --------------------- The 'graphic' option was used to make the characters between <~> and 0xa0 display directly on the screen. Now the 'isprint' option takes care of this with many more possibilities. The default setting is the same; you only need to look into this if you previously set the 'graphic' option in your vimrc. |'isprint'| 'yankendofline' option gone *ye_option_gone* --------------------------- The 'yankendofline' option has been removed. Instead you can just use :map Y y$ 'icon' and 'title' default value changed *icon_changed* ---------------------------------------- The 'title' option is now only set by default if the original title can be restored. Avoids 'Thanks for flying Vim" titles. If you want them anyway, put ":set title" in your vimrc. |'title'| The default for 'icon' now depends on the possibility of restoring the original value, just like 'title'. If you don't like your icon titles to be changed, add this line to your vimrc: |'icon'| :set noicon 'highlight' option changed *highlight_changed* -------------------------- The 'i' flag now means italic highlighting, instead of invert. The 'r' flag is used for reverse highlighting, which is what 'i' used to be. Normally you won't see the difference, because italic mode is not supported on most terminals and reverse mode is used as a fallback. |'highlight'| When an occasion is not present in 'highlight', use the mode from the default value for 'highlight', instead of reverse mode. 'tildeop' and 'weirdinvert' short names changed *short_name_changed* ----------------------------------------------- Renamed 'to' (abbreviation for 'tildeop') to 'top'. |'tildeop'| Renamed 'wi' (abbreviation for 'weirdinvert') to 'wiv'. |'weirdinvert'| This was done because Vi uses 'wi' as the short name for 'window' and 'to' as the short name for 'timeout'. This means that if you try setting these options, you won't get an error message, but the effect will be different. Use of "v", "V" and "CTRL-V" in Visual mode *use_visual_cmds* ------------------------------------------- In Visual mode, "v", "V", and "CTRL-V" used to end Visual mode. Now this happens only if the Visual mode was in the corresponding type. Otherwise the type of Visual mode is changed. Now only ESC can be used in all circumstances to end Visual mode without doing anything. |v_V| CTRL-B in Insert mode removed *toggle_revins* ----------------------------- CTRL-B in Insert mode used to toggle the 'revins' option. If you don't know this and accidentally hit CTRL-B, it is very difficult to find out how to undo it. Since hardly anybody uses this feature, it is disabled by default. If you want to use it, define RIGHTLEFT in feature.h before compiling. |'revins'| Q command in normal mode renamed to "gq" *Q_renamed* ---------------------------------------- The Q command was used in vim 3.0 to rewrap paragraphs, but in standard vi Q is the command to switch from "visual" mode to "ex" mode, and vim now has an "ex" mode. NEW AND IMPROVED FEATURES *new_features* ========================= New on-line help system *new_help* ----------------------- Help is displayed in a window. The usual commands can be used to move around, search for a string, etc. |online_help| All the documentation is in the help system: index, reference, etc. Tags can be used to jump around, just like hypertext links. The ":help" command accepts an argument that can be the name of a command. A help window is opened and the cursor is positioned at the help for that command. The argument is looked up in the help tags file, using a fuzzy match algorithm. The best match is used. |:help|. Added 'helpheight' option: Minimal height of a new help window. Made the default help key for all systems. Display "[help]" in the status line of a help window. Help files are always started in readonly mode. Tag support improved *new_tags* -------------------- Added support for static tags, "file:tag ...". See |static_tag|. Use the tag with best match: First tag in current file, then global tag in other file, finally static tag in other file. Match with same case always goes before match with case ignored. A few attempts are made to find a tag. See |tag_priority|. Added ":stag", same as ":tag", but also split window. See |:stag|. When deleting/inserting lines, the marks in the tag stack are adjusted to reflect this change. Command-line completion for tags is improved. Tags are allowed to start with a number. For file names that start with "./" in the 'tags' option, the '.' is replaced with the path of the current file. This makes it possible to use a tags file in the same directory as the file being edited. When comparing the current file name with the file name for the tag, consider the path too, otherwise tag in wrong directory could be used. Added support for Emacs style tags file (if "EMACS_TAGS" has been defined at compile time). Now Vim is one of the few editors that supports both tag file formats! When executing the search command to find the pattern from a tags file, the first try is with matching case; if this fails, try again ignoring case. The 't' flag in 'cpoptions' can be set to remember the search pattern used for tag search. A following "n" will use it. This is Vi-compatible, but it is rarely useful. Added CTRL-] command to Visual mode: :ta to highlighted text (only when no more than one line is highlighted). Same for "K": Use keyword program for highlighted text. |v_CTRL-]| Command-line editing improvements *new_commandline* --------------------------------- There is no longer one command-line history. The search strings are now in a separate list, where they can be accessed only when entering a search string. |cmdline_history| The search string for a tag search is always put in the search history; this does not depend on the 't' flag in 'cpoptions'. Only command lines and search strings where at least one character was really typed by the user are put into the history. For command-line history, exchanged meaning of and keys, and keys. That is more like other uses of command-line history (shell) and some keyboards don't have shifted cursor and page keys, which makes it impossible for this feature to be used. |c_| Put all search strings, including those from "*" and "#" commands, in the search history. Added completion of old settings. For example: ":set hf=". Makes it possible to change an option without completely retyping it. Backslashes are inserted where necessary. Fixed command-line completion when entering the range of lines. When completing file names, insert a backslash before , '\', '#' and '%' to avoid their special meaning. When a command-line is already in the history, the old entry is removed. When searching through the command history, the entry from which it was started is remembered. Added paging for showing matches on the command line. This can also be interrupted. Added CTRL-R command on command-line: Insert contents of register. Output '"' after CTRL-R command, to indicate that a register name has to be entered. |c_CTRL-R| Improved indenting for C programs *new_cindent* --------------------------------- The 'cindent' option and friends have been added. It automates the indenting for C programs. It is not 100% correct in all cases, but good enough for normal editing. |'cindent'| The "=" operator can be used to indent some lines of text with the internal indenting algorithm; it is used when 'equalprg' is empty, which is the default now (most implementations of the "indent" program can't work as a filter anyway). |=| Added automatic formatting of comments and the 'comments' option. |format_comments| The 'formatoptions' option can be used to change when formatting is done and to select the formatting method. The 'smartindent' option is still there; it's useful for non-C code and C code that doesn't conform to what is supported by 'cindent'. Improvements for 'smartindent': |'smartindent'| - When entering '{', indent is not rounded to 'shiftwidth'. - When entering '}' and the matching '{' is preceded with a '(', set indent to the line containing the matching ')' - Ignore lines starting with '#'. - When typing '{' after "O", delete one indent, unless indent of previous line is less or equal. - Don't add an indent when inserting a NL before a '{'. - Do smart indenting after "cc" or "S". Fixed bug where } would only be smart-indented to line up with the line containing the { when there was some spacing before the }. The 'cinwords' option can be set to keywords that start an extra indent for 'smartindent' and 'cindent' mode. This used to be a table in the C code; now it is configurable. The defaults are the same, and it should make no difference unless you change the 'cinw' option. |'cinwords'| Searching for words in include files *new_include* ------------------------------------ Commands have been added that not only search in the current file, but also in included files. The 'include' option can be set to a pattern that includes a file (the default is for C programs). |include_search| The search can be done for identifiers with "[i" or defines with "[d". Use ":checkpath" to check if included files can be found. |:checkpath| A jump to the first found match can be done with "[ CTRL-I" or "[ CTRL-D". This is very useful to jump to the definition of a variable. |[_CTRL-I| Added ":isearch", ":ilist", ":ijump", ":isplit", ":dsearch, etc. Allows for an identifier to be found that is not in the text yet. |:isearch| Word completion in Insert mode *new_complete* ------------------------------ In Insert mode the word before the cursor can be completed with CTRL-N and CTRL-P. There used to be mappings for this, but the internal implementation has better support for errors, ignores duplicates, etc. |compl_current| CTRL-X mode has been added. It is a sub-mode in Insert mode, where commands can be used to scroll the text up or down, |i_CTRL-X_CTRL-E|, and completion can be done is several ways. |ins_completion| Completion can be done from a dictionary, defined with 'dictionary'. This is very useful when typing long words. |i_CTRL-X_CTRL-K| In C programs completion can be done from included files. This is very useful when typing long function or structure names, e.g., for X windows. |i_CTRL-X_CTRL-I| There is also completion for whole lines |i_CTRL-X_CTRL-L|, tags |i_CTRL-X_CTRL-]|, file names |i_CTRL-X_CTRL-F|, and defines |i_CTRL-X_CTRL-D|. Added 'infercase' option. When doing keyword completion in Insert mode, and 'ignorecase' is also on, the case of the match is adjusted. |ins_completion| Automatic commands *new_autocmd* ------------------ On certain events a set of commands can be executed, depending on the file name. Supported events are starting to edit a file, moving to another buffer, moving to another window, etc. This can be used to set 'cindent' on for C-code files only, set 'dictionary' depending on the type of file, set mappings for certain file types, edit compressed files, etc. |autocommand|. Added ":normal[!] {command}", execute Normal mode command from cmdline. Useful for autocommands. Use with care! |:normal| Text objects *new_textobj* ------------ After an operator and in Visual mode, text object commands can be used to select a word, line, or paragraph. |object_select|. a word object A WORD object s sentence object p paragraph object S object between '(' and ')' P object between '{' and '}' A few examples: "da" delete the word under cursor "vPPP" select blocks "yP" yank the current block ">P" increase the indent for the current block The space after or before the object is included. Options *new_options* ------- Allow white space between option name and following character. ":set ai ?" works now. Added '&' after option: reset to default value. Added '!' after boolean option: invert value. |set_option| For setting numeric options, hex and octal can be used. When setting an option that is a list of flags, give an error messages for illegal characters. Also for 'highlight' option. Environment variables in options are now replaced at any position, not just at the start. |:set_env| For string options, a Tab ends the string; this is Vi-compatible. When setting a hidden string option, skip backslashed blanks. When expanding the value of a string option, insert a backslash before a Tab. Updated makeset() and putescstr() for putting a backslash before the Tab. |:set| Names in 'tags', 'path', 'dictionary', and 'suffixes' options can also be separated with commas. Commas in environment variables and file names are no longer allowed. A comma can be included in these options by preceding it with a backslash. Spaces after a comma are ignored. |'tags'| Added the 'shortmess' option. It is a list of flags that can be used to shorten the messages that are given when reading or writing a file, avoiding the "Hit return to continue" prompt. When 'terse' is set, 's' flag is added to 'shortmess'. When 'terse' is reset, 's' flag is removed from 'shortmess'. |'shortmess'| Added 'scrolloff' option: Make that many lines of context visible around the cursor. If "so=999", the cursor line is always in the middle of the window. |'scrolloff'| Added 'ttybuiltin' option: try builtin termcaps before external ones; default: on. When a terminal is known both in the builtin termcap and in the external one, use entries from both. Which entry is used first depends on 'ttybuiltin'. |'ttybuiltin'| Added 'ttimeoutlen' option: Like 'timeoutlen' but for key codes only. When set to negative number (which is the default), 'timeoutlen' is used. |'ttimeoutlen'| Implemented incremental search; use 'incsearch' option to switch it on. |'incsearch'| Added options for adjusting character set and characters in identifiers: 'isident' - Characters in identifiers |'isident'| 'isprint' - Characters that can be displayed directly |'isprint'| 'iskeyword' - Characters that are in (key)words |'iskeyword'| 'isfname' - Characters that can be in a file name |'isfname'| Increased default for 'undolevels' for Unix and Win32 from 100 to 1000. |'undolevels'| Changed 'directory' and 'backupdir' into a list of paths. '.' is the same directory as the file. 'backupdir' now also works for non-Unix systems. No need for weird ">" character to avoid current dir. If ">" has been given anyway, it is automatically removed (for backwards compatibility with 3.0). Made default for 'directory' ".,~/tmp,/tmp". |'directory'| Changed default for 'backupdir'. Used to be ".", now it's ".,~" for Unix; likewise for other systems. Helps when current directory is not writable (but the file is) and 'writebackup' is set. |'backupdir'| Changed default for 'keywordprg' to "man" (except on MS-DOS or Win32); much more useful for most of us. When 'keywordprg' is empty, ":help" is used, get help for word under the cursor. |'keywordprg'| Added the 'startofline' option. When off, a lot of commands that move the cursor up or down don't put the cursor on the first non-blank on the line. Example: This makes CTRL-F followed by CTRL-B keep the cursor in the same column. |'startofline'| Added options 'flash' and 'novice' for Vi compatibility; they are not used. |'flash'| |'novice'| Accept special key sequence, e.g., , when setting 'wildchar'. Give error message when setting 'wildchar' option to non-number. |'wildchar'| Added types to 'highlight' option: |'highlight'| m for -- more -- message t for titles n for the line number that is shown with the ":number" command. 8 for meta keys w for "search hit TOP .." messages M for mode message (e.g., "-- INSERT --"). When filtering, use the 'shellredir' option to redirect the output. When possible, 'shellredir' is initialized to include stderr. |'shellredir'| Moved initialization of 'shellpipe' and 'shellredir' to after other initializations, so that they work correctly when 'shell' option is set. |'shellpipe'| Added '2' to 'formatoptions': 'gq' (formerly Q) will keep the indent of the second line of a paragraph. |'formatoptions'| Added 'maxmapdepth' option: maximum recursiveness of mapping. |'maxmapdepth'| Added 'smartcase' option: Don't ignore case if a typed search pattern contains uppercase characters. |'smartcase'| Added 'langmap' option, for those who put their keyboard in language mode, e.g., Greek. Only if HAVE_LANGMAP defined at compile time. |'langmap'| Changed default for 'errorfile' option from "errors" to "errors.vim", to reduce the risk of accidently overwriting an existing file. |'errorfile'| Changed 'whichwrap' into a string option. When setting it to a number, it is automatically converted, for backwards compatibility with 3.0. |'whichwrap'| Expand environment options for 'term'; allows ":set term=$TERM". |'term'| Replace 'nobuf' by 'writedelay' ('wd'), time to delay writes by. Makes it possible to reduce the writing speed to almost nothing. |'writedelay'| Added 's' and 'S' flags to 'cpoptions', influence the behaviour of options for a buffer: Copy when created, copy when first entered, or copy every time. Compatible with version 3.0 by default, compatible with Vi when 'S' included. |'cpoptions'| When 'bin' option is set, save the values of the options that are set to 0. Restore the values when 'bin is reset. |'bin'| Added 'ttyscroll' option: Maximum number of screen lines to do scroll with. When trying to scroll more lines, redraw the window. |'ttyscroll'| Added 'modified' option. It's now possible to force a file to be modifed or not modified. |'modified'| Support for editing one-line paragraphs *new_para* --------------------------------------- Sometimes it is useful to keep a paragraph as a single long line. A few facilities have been added to make it easier to edit this text. When the 'linebreak' option is set, long lines are broken at a convenient character. This can be defined with the 'breakat' option. By default, this is " ^I!@*-+_;:,./?". |'linebreak'| The 'showbreak' option can be set to the string to display on continuation lines. This makes it easy to see which lines have been broken. |'showbreak'| The commands "gk", "gj", "g0", "g^" and "g$" have been added: Move a screen line. They differ from "k", "j", etc. when lines wrap. |gk| |g0| Usage of key names *new_keys* ------------------ Special keys now all have a name like , , , etc. This name is used for mappings, in listings, and many other things. It can be disabled by adding the '<' flag in 'cpoptions'. |key_notation| For keys that don't have a <> name, but do have a termcap name, the form can be used. The "xx" entry from the termcap is used. |terminal_options| Show meta keys in mappings as M-key. Use highlight option '8' for higlighting the meta keys. |meta| Added a few special keys. and work like CTRL-B and CTRL-F. || || goes to column one, goes to end of line, in Insert and Normal mode. || || in normal mode starts Insert mode; in insert/replace mode, toggles between insert and replace mode; in command-line editing, toggles between insert and overstrike. || |i_| |c_| It is now possible to use both and (they used to be the same key). |function-key| Viminfo *new_viminfo* ------- A lot of the history that is kept in Vim (command-line history, marks, registers, etc) can be stored in a viminfo file. It is read on startup, restoring your last environment. |viminfo_file|. Compilation improvements *compilation* ------------------------ The Unix version has a completely different Makefile. Autoconf is used to adjust to different Unix flavors. Prototypes for functions are obtained from include files, missing prototypes are used from osdef.h. It should be much more straightforward to compile Vim on a Unix system. |vim_unix.txt| The INSTALL file now contains instructions for compiling. In 3.0 you needed an Amiga C compiler to generate prototypes. Now it can be done on Unix too, by using cproto. A lot of warning messages for GCC have been removed. A makefile target, 'make shadow', helps for building Vim for multiple machines in the same source tree. It is a poor man's VPATH---but much more portable and flexible than any trick that gmake could perform: It creates a subdirectory called shadow containing all the required symbolic links. For example, try 'make shadow; mv shadow sun4-gcc; cd sun4-gcc; ./configure' Improved (error) messages *new_msg* ------------------------- Give error messages that includes the command line for ":" commands that are not typed by the user. Changed "Invalid command" message into ": Not an editor command". When an error message is given while sourcing, starting up, executing autocommands, or modelines, the source of the error and line number are mentioned. Don't sleep after giving an error message. Error messages now never overwrite other messages and each other. Distinguish between an unimplemented Ex command and an unrecognized command in the error message. When jumping to file under cursor, give proper error message instead of beep. |gf| Changed the displaying of messages for many commands. Makes ":1p|2p" work. Avoids having to type some extra returns. Added error message for using '!' in the command-line where it is not allowed. Added wait_return() when filtering finds an error while executing the shell command. Makes it possible to read the error message. When printing errors for ":set", use transchar() to avoid problems with non-printable characters. |:set| Fixed having to type RETURN twice when starting to edit another file and the message is too long. When search pattern is not found or contains an error, print the pattern. |search_pattern| Improved error message for unrecognized command in vimrc. Now the whole line is displayed. |vimrc| When error detected while writing a file, give error message instead of normal message. Improved error messages for some options: Show character that caused the error. Completely changed 'showcommand'. Now also shows parts of mappings, CTRL-V, etc. |'showcmd'| Changed the messages given when 'showmode' is set. Show VISUAL when Visual mode is active. Changed "-- INSERT COMMAND --" to "-- (insert) --". Add "(paste)" in Insert mode when paste option is set. Add [RO] to status line for read-only files. Improved error messages for using '%' and '#' on command-line. An error in a regular expression would get two error messages. The last one, "invalid search string" is now omitted. Don't get the "hit RETURN to continue" message. Swap file *new_swapfile* --------- The "swap file exists" message used to be given when the name of an existing swap file matches the name of a new swap file. Now this only happens when the name of the original file is also the same. This is implemented by storing the name of the file in the swapfile and always writing the first block of the swap file to disk. Helpful when putting all swap files in one directory. Unix: Give swapfile same protection as original file: makes it possible for others to check the file name in the swap file. Unix: Store the inode of the original file in the swap file. Use it when checking if the swap file is for a certain file. Helps when editing the same file with a different path name (over a network). |swap_file| Give more information about the swap file with the "swap file exists" message and when recovering. Added 'swapsync' option: When empty swap files are not synced (for busy Unix systems). When set to "sync", sync() is used; when set to "fsync", fsync() is used. Makes it possible to fix complaints about pauses. The default is "fsync". |'swapsync'| Reduce the calls to fsync() or sync. Don't call it when syncing block 0 or when the file has not been changed. Don't sync block 0 for a help file. When file system is full, the error message for writing to the swap file was repeated over and over, making it difficult to continue editing. Now it is only given once for every key hit. Included catching of deadly signals for Unix and Win32. Swap files for unmodified buffers are deleted, other swap files are preserved before exiting. After catching some deadly signals, produce a core dump. Added ":recover [file]" command, for recover after getting the "swap file exists" message. |:recover| Improved recovery when there are multiple swap files. You get a choice which one to use (the swap file from the active editing session is ignored). "Vim -r" gives information about date and contents of the swap files. Allow ":recover" without a file name, to recover from ".swp". |-r| Use home_replace() for the file names displayed during recovery. When editing in readonly mode, don't set p_uc to zero and do use a swap file. Fixes problem of not being able to edit large files with "Vim -v". 'uc' is set to 10000 to reduce the number of writes to the swapfile. |'updatecount'| When looking for swap files, also consider the shortname version. Finds swapfiles on MS-DOS (FAT) file systems. |swap_file| When encountering a serious error while doing "vim -r file" (like swap file not found or empty swap file), quit Vim. |-r| MS-DOS and Win32: Always use full path name for swap file; otherwise it can't be deleted after using ":!cd dir". |swap_file| Mouse support *new_mouse* ------------- The mouse is supported in an xterm and for MS-DOS and Win32. This can be controlled with the 'mouse' option. |mouse_using| |'mouse'| The mouse can be used for: - positioning the cursor in the text || - positioning the cursor in the command-line |c_| - selecting the Visual area || - inserting (previously) selected text at the cursor positon || - moving a status line |drag_status_line| - selecting the active window || - jumping to a tag in the text || |g| - popping a position from the tag stack || |g| - confirming the "Hit return to continue" message |'mouse'|. - etc. By default, the mouse support is off for Unix, allowing the normal copy/paste with the mouse in an xterm. Switch it on with ":set mouse=a". For MS-DOS, Win32, and GUI, the mouse is on by default. When quickly repeating a mouse click, this is recognized as a double, triple or quadruple click. The 'mousetime' option sets the maximum time between two clicks for GUI, MS-DOS, Win32, and xterm. |'mousetime'| Graphical User Interface (GUI) *new_gui* ------------------------------ Included support for GUI: menus, mouse, scrollbars, etc. Currently only with Motif and Athena interface. You need at least Motif version 1.2 and/or X11R5. Motif 2.0 and X11R6 are OK. Motif 1.1 and X11R4 don't work properly (but you might make it work with a bit of work) |gui|. Added options for GUI: 'guioptions' (list of flags that set the GUI behaviour) |'guioptions'| 'guifont' (list of fonts to be used) |'guifont'| 'guipty' (whether to use pipes or pty for external commands) |'guipty'| Added text register '*' (for text selected in GUI with mouse). |registers| Support for Windows NT and Windows 95 *new_win32* ------------------------------------- There is now a new version for NT that can also be used for Windows 95. It supports long file names, uses all available memory, and many more enhancements. |vim_w32.txt| There is also an MS-DOS version that has been compiled with DJGPP. It uses all available memory. It supports long file names when available. |vim_dos.txt| Support for OS/2 *new_os2* ---------------- There is now a version of Vim for OS/2. It was compiled with EMX, which made this port quite easy. It mostly uses the Unix files and settings. |vim_os2.txt| Support for MiNT *new_mint* ---------------- There is now a version of Vim for MiNT. It was compiled with gcc under a Unix-like environment. |vim_mint.txt| Ex mode commands added *new_ex* ---------------------- Vim now works in Ex mode when invoked as "ex" or when the Q command is used. The :append, :change, :insert, and :z commands now function like standard vi. Miscellaneous new features *new_misc* -------------------------- When using CTRL-A and CTRL-X, leading zeros are preserved for octal and hexadecimal numbers. |CTRL-A| |CTRL-X| "%" now works to match comments of the form "/* Comment /* */". |%| Added "gd", Go Declaration: search for identifier under cursor from the start of the current function. "gD" searches from start of the file. Included files are not used. |gd| |gD| Added commands ":ascii" and "ga", show value of character under the cursor in several ways. |ga| |:ascii| Added "gg" command to goto line 1. |gg| Added "gI" command: Start insert in column 1. |gI| Added "g~", "gu" and "gU" operators, change case of selected text. |g~| |gu| |gU| Added "ge" and "gE", go back to end of word or WORD. |ge| |gE| Added "g CTRL-G": Display info about the position of the cursor. |g_CTRL-G| Added virtual column number to CTRL-G. |CTRL-G| When using count > 1 with CTRL-G, show buffer number. Added "gv" command: reselect last Visual area. In Visual mode, exchange the current and the previous Visual area. |gv| Implemented "zh" and "zl": scroll screen left/right when 'wrap' is off. Implemented "zs" and "ze": scroll screen with cursor at start or end of screen when 'wrap' is off. |zh| |zl| |zs| |ze| Added "g*" and "g#" commands: like "*" and "#" but without using "\<" and "\>" for matching whole words. |gstar| |g#| Put character attributes in a separate byte in NextScreen; makes updating of highlighted parts more reliable. Added column number to ":marks" command. |:marks| Improved error messages for marks that are unknown, not set, or invalid. Added ''' mark to ":marks". Added argument to ":display" and ":marks", show info for the argument. |:marks| |:display| Added the ":retab" command. Can be used to change the size of a , replace spaces with a , or a with spaces. |:retab| If VIMINIT is set but is empty, ignore it. |VIMINIT| Added ":ls", synonym for ":files". |:ls| Included setting of window size for iris_ansi window. Included better checks for minimum window size and give error message when it is too small. When resizing the window and 'equalalways' is set, make all windows of equal height (all lines were taken/given from/to the last window). When using the 'c' flag for the ":substitute" command, accept CTRL-E and CTRL-Y to scroll the window up/down. For ":s///c", the complete match is highlighted (like with incsearch). When doing ":s/$/asdf/c", highlight one character beyond the end of the line to show where the substitute will take place. Added 'a' reply to substitute with confirmation: like 'y' for all remaining replacements. |:s_c| For ":s", don't accept digit as separator; ":s8foo8bar8" doesn't work. |:s| Changed "--more--" prompt to be more informative when a wrong key is typed. When 'q' is typed at "--more--" message, don't display an extra line, don't wait for return to be hit. Added 'd' to --more-- responses: down half a page. Added ':' to --more-- responses: start editing a command-line. |'more'| Put the cursor after the end of the line in Insert mode when using "CTRL-O $", "CTRL-O 80|", and when putting text after the line. |i_CTRL-O| When splitting a window, the new window inherits the alternate file name. With ":split [file]" and ":new [file]", the alternate file name in the current window is set to [file]. |:split| Added CTRL-W CTRL-^ command: split and edit alternate file. |CTRL-W_CTRL-^| Made it possible to put options for Vim after a single "-", e.g., "vim -gf". Allow "--" to make arguments after it be interpreted as file names only. Give error message when repeating "-s" or "-w" option. Implemented "Vim -r" to list any swap files that can be found. In version 3.0 this command used to crash Vim. |-r|. Removed reverse replace mode (can we call this a new feature?). It is too complicated to do right and nobody will probably use it anyway. Reverse insert is still possible. |'revins'| Added "gq" as an alias to "Q". The "Q" command will be changed in a following version of Vim, to make it Vi compatible (start Ex mode). |gq| The "gq" operator (formerly Q) no longer affects empty lines. You can now format a lot of paragraphs without losing the separating blank lines. Use "gqp..." to format a few consecutive paragraphs. |gq| Formatting with "gq" fixes up the indent of the first line (replace with minimal number of tabs/spaces). |gq| After "gq", put cursor at first non-blank of the last formatted line. This makes it easier to repeat the formatting. Made "gq}" put the cursor on the line after the paragraph (where the "}" command would have taken the cursor). Makes it possible to use "." to format the next paragraph. |gq| When formatting with "gq" while 'tw' and 'wm' are both zero, use a textwidth of 79, or the screen width minus one if that is smaller. Joining all the lines doesn't make sense for the "gq" command. |gq| Added CTRL-W CTRL-T (go to top window) and CTRL-W CTRL-B (go to bottom window). |CTRL-W_CTRL-T|. When in Insert mode and wrapping from column one to the last character, don't stick at the end but in the column with a following "k" or "j" command. Added "[P" and "]P" as synonyms for "[p". These commands are now redoable. Fixed cursor positioning and character-wise text. |[p| Improved the handling of empty lines for "[p" and the like. |[p| Improved ":center", ":right", and ":left"; blank lines are no longer affected, tabs are taken into account, trailing blanks are ignored. |formatting| Made '.' in 'path' be replaced with directory of current file. Makes "gf" work on "#include "vim.h"" when editing "src/normal.c". Empty part in 'path' stands for current directory. |gf| |'path'| Added '-' register for deletes of less than one line. |registers|. When :bdel and :bunload are used to remove buffers that have active windows, those windows are closed instead of giving an error message. Don't give an error message when some, but not all, of the buffers do not exist. Added buffer name argument to ":bunload" and ":bdelete". Completion also works, and '%' and '#' can be used. |:bdelete| |:bunload| When file name changed, also change name of swap file. This makes it easier to find the swap file for recovery. |swap_file| The Amiga trick for recognizing an MS-DOS-compatible filesystem is now also done for UNIX. Fixes problems with wrong swap file and backup file name on an MS-DOS partition for FreeBSD and Linux. |auto_shortname| When writing the file fails and there is a backup file, try to put the backup in place of the new file. Avoids losing the original file when trying to write again and overwriting the backup file. |write_fail| If 'backup' is off and 'writebackup' is on, don't delete an existing backup file; instead use another file name. |backup_table| When going to another window in Visual mode: if it is the same buffer, update Visual area; if jumping to another buffer, reset Visual mode. |Visual_mode| When an empty buffer is edited and written out, that file is also empty. Added "No lines in buffer" message when last line in buffer is deleted. Added checks for creating too long lines on non-UNIX systems. |limits| When last file in argument list has been accessed, quit without asking. This works more intuitively when using ":prev". |arglist_quit| Set alternate file name when using buffer commands like ":bmod", ":buf", ":bdel", etc. |:buffer| Changes to quickfix: ":cl" lists only recognized errors, use ":cl!" to list all. ":cn" and ":cp" don't go to an unrecognized error but give an error message when at the first/last error. When a column number is not found, put the cursor at the first non-blank. When deciding to redisplay the message or not, take tabs into account. When ":cp" or ":cn" fail for some reason, don't change the error index. Changed the format of the ":cl" listing. Don't show the column number if it is zero. Take care of tabs when displaying an error message. Error number or count can also be before ":cc", ":cp", and ":cn". |quickfix| When asked a yes/no question, ESC is the same as 'n'. |:s_c| Removed a few large arrays from the stack; MS-DOS was running out of stack space. Added ":view file" and ":sview file": start editing a file with 'readonly' set. |:view| |:sview| Removed restriction on command-line length. When adding a jump to the jumplist, remove older jumps to the same line. |jumplist| Added separate mapping for normal mode and Visual mode. New commands ":nmap", ":nnoremap", ":nunmap", ":vmap", ":vunmap", and ":vnoremap". |:nmap| When 'visualbell' is set and 't_vb' is empty, don't beep or flash or anything (used to display some ^G in the command-line which was deleted before you could see it). |t_vb| |'visualbell'| Added "-u vimrc" Vim argument: Read initializations only from specified vimrc file and skip the other initializations. Use "-u NONE" to skip. |-u| Added "-i viminfo" Vim argument: Set name for viminfo file. Use "-i NONE" to skip reading viminfo. |-i| For commands that get a file name out of the text (e.g., "gf", "[f"), ignore the part of a hypertext link that gives the file type and machine name. |gf| When 'columns' or 'lines' is changed, try to set the window size. Termcap stuff is not used when not in full-screen mode. Process modelines after recovering a file. When checking modelines runs into an error, don't check other lines. |modeline| When 'wrap' option is off, make sure the whole character under the cursor is on the screen (for TAB and non-printable characters). |'wrap'| Added '\r', '\n', '\b', '\e' and '\t' to regular expressions. Added "\i" to regular expressions, match identifier character. "\I" does the same but without digits (for start of identifier). Also added "\k" and "\K" for keywords, "\f" and "\F" for file name, "\p" and "\P" for printable characters. |search_pattern| The trick in GetChars() in unix.c to keep on reading characters until none are available is not done if Read() returns more than one character. Should speed up getting characters from the keyboard on many systems. Added implementation of 'lisp' option. It is not 100% the same as Vi. Added "-l" Vim argument: Switch lisp mode on. |-l| MS-DOS: Only beep once in ten times between key hits. Needed because beeps take a lot of time to wait for. Made argument to GetChars a long; makes it possible to wait for more than 32 seconds on 16-bit machines (for the very patient). |'timeoutlen'| Made "#" and "*" find the text under the cursor. |star| |#| Unix: Expand path names starting with "~" to full path names. Makes "gf" work on "~user/path". |gf| Fixed behaviour of "x" and "X", when 'whichwrap' is set, to include 'l' and 'h' for wrapping. Now "x" on an empty line deletes that line and "X" in column 0 joins the line with the previous line. |x| |X| |'whichwrap'| When doing ":make" and 'autowrite' is set, write all buffers, not just current one. Just like ":!cmd". |:make| ":make" now shows the command that is executed by the shell, including 'shellpipe' and 'errorfile'. Helps to understand how 'shellpipe' is used. |:make| Allow for digraphs to be entered in reverse: Char1-char2 and char2-char1 both work. |digraphs| When 'splitbelow' is not set, the space from closing a window goes to the window below it instead of above it. Makes the sequence split-window, close-window not change the window layout. |'splitbelow'| Added '< and '> mark. '< is lowest position of Visual area and '> highest position. Use ":'<,'>" when ":" is used in Visual mode. Makes it possible to use the command-line history. |'<| Implemented ":*", which is short for ":'<,'>", Visual area. |:star| Stop Visual mode when starting to edit another file (e.g., with "'A"). When doing ":xit" or "ZZ" in a window for a buffer that has changed, write the buffer even if there are other windows on this buffer. |:xit| Give a warning message when 'patchmode' and 'backupext' are equal. When input/output is not from/to a terminal, just give a warning message, don't exit. In Insert mode, CTRL-K ESC does not exit Insert mode. The two characters typed after CTRL-K are not mapped. Typing a special key after CTRL-K inserts the <> name. CTRL-V inserts the terminal key code (except in the GUI). |i_CTRL-K| |i_CTRL-V| Improved screen output. The cursor positioning code is avoided whenever possible. When outputting a char on the next line, column zero, use CR-LF to go there instead of cursor positioning, which uses fewer characters. Added using scroll regions when inserting/deleting screen lines. Works faster for terminals that don't have erase/delete line functions but do have scrolling regions (vt100). |t_cs| No longer do home_replace() when it results in just "~"; it was confusing that 'backupext' and 'backupdir' are both shown as "~" by default. Unix: When making a backup file, set the group the same as the group of the original file. If this fails, set the protection bits for the group to be the same as for others. |'backup'| Fixed: When 'textauto' is set, only the first line was used to decide to set or reset 'textmode'. Would cause problems for, say, a file with mappings. Now when editing a file where the first line ends in ^M, but a later one doesn't, the file is reloaded in notextmode. |'textauto'| When sourcing a file on MS-DOS, Win32, or OS/2 and 'textauto' is set, try to recognize non-textmode files by the first line. |:source_crnl| For ":" commands that have one file name argument: Only Unix sees the space as a file name separator. For Amiga, MS-DOS, et al., a space is considered to be part of the file name (except a trailing space). For Unix, don't give an error message for an argument with spaces when a wildcard is used; give the error when expanding the wildcard results in more than one file. This allows the use of ":e `ls ve*.c`" on Unix. When replacing the name of the home directory with "~", try both $HOME and the "real" home directory: `cd $HOME; pwd`. Fixes problems when home dir is mounted or contains links. Fixed home_replace replacing "/home/pieter/file" with "~er/file" when home is "/home/piet", Command-line completion on file names and buffer names use "~/" for home directory when approriate. When completing with CTRL-L and there are multiple matches, beep! Ignore case when comparing file names for MS-DOS and Win32. For Amiga, don't ignore case for non-file names. |c_CTRL-L| Added ":registers" as a synonym for ":display". |:registers| Added check for "locale.h"; renamed USE_LOCALE to HAVE_LOCALE_H. Recognize a terminal name as xterm when it starts with "xterm" and iris-ansi when it starts with iris-ansi. This will also catch "xterms". Also: ignore case, catch "Xterm". This is used when deciding to use the window title. Unix: If terminal is xterm, hpterm, dtterm, sun-cmd, screen, or iris-ansi, set 'ttyfast' option. Added builtin termcap entry for iris-ansi. The entry in the termcap is often wrong. |'term'| Included SAVE_XTERM_SCREEN in feature.h, to include the t_ti and t_te entries for the builtin xterm. They enable saving the xterm contents when starting Vim and restoring it on exit. |xterm-screens| Special trick to make copy/paste of wrapped lines work with xterms: If the first column is to be written, write the last char of the preceding line twice. This will work with all terminal types (regardless of the xn,am settings). (Juergen Weigert) But only when 'ttyfast' is set. When 'title' and/or 'icon' is reset in vimrc, don't even check if they can be restored. This reduces startup time when using Vim in an xterm on a remote machine. |'title'| When coming back from a CTRL-Z, before setting title, store the current title again for restoring later, as it might have changed. |'title'| Expanding shell variables works now. Also made ":e $VAR^I", ":e this$VAR^I", and ":e `echo hi`^I" expand correctly by not adding a "*" in these cases. Command-line expansion: Command after '+' will be expanded; e.g., in ":e +s^D". Where file names may be expanded, support for back-quotes has been added. |+cmd| Set '[ and '] marks to start and end of undone/redone lines. Set '[ and '] to start/end of inserted text after inserting text. |'[| Marks in the jumplist are not deleted when deleting lines; avoids "mark not set" error messages when using CTRL-O command. If there are two marks for the same line, the oldest one is removed. |CTRL-O| Added setting of previous context mark when changing files (with ":e file" or ":n" or ":buf n"). Now you can go back with CTRL-O. |CTRL-O| Added list of options that are enabled/disabled at compile time to ":version" command (+GUI -digraphs -eindent, etc.). For Unix, add a line to the ":version" command to show how it was compiled. |:version| Added ":if" and ":endif" commands. Everything in between them is ignored. This is just for being able to add future commands to vimrc files in a backwards compatible way. |:if| Made CTRL-N and CTRL-P for command-line completion line cyclic. |c_CTRL-N| "" in the command line where a file name is expected is expanded to the current word under the cursor. "" is expanded to the WORD under the cursor, "" to the file name under the cursor. "" is expanded to the file name for the current autocommand. |:| Added character 163 (pound sign on English keyboards) as an alternative for the '#' command. |#| Added ":cNext" as a nickname for ":cprevious". |:cNext| Made ":bnext" and ":bNext" wrap around the end of the buffer list. |:bnext| When a regexp contains a '[' without a matching ']', assume the '[' is a normal character. This makes ":help [" work. |search_pattern| When "[{" or "]}" is used with a count > 1, and not enough levels are found, just use the last match found. Makes "99[{" go to the start of a function. |[{| Added commands to search for #if/#endif and start/end of comment: "[#", "]#", "[*", "[/", "]*" and "]/". |[#| |[*| |[/" Added break checking to do_do_join(); makes it possible to use CTRL-C when joining lots of lines. |J| Made it possible to include ":sall" in vimrc. main() won't open the buffer and won't split the windows when this already has been done by a command in the vimrc. Added count to ":sall", ":sunhide" and ":sball": maximum number of windows. |:sall| Added ":abclear" and ":mapclear": remove all abbreviations/mappings. |:mapclear| |:abclear| MS-DOS: For Visual mode, always invert the character under the cursor, also when cursor cannot be switched off (it's mostly not a block cursor). |t_vi| Made ":g/#/d" a lot faster by not calling cursupdate() for each deleted line. |:global| When opening windows for all buffers or arguments, make one window with at least 'winheight' or 5 lines. Avoids ending up with all one line windows. |:all| |:ball| MS-DOS and Win32: Always use a backslash in file names. Using a slash caused trouble with some external commands. Using a backslash before a normal filename character is now allowed for most commands. Added check for last modification time of original file before overwriting it. When it has changed since reading or writing it, ask the user if he wants to overwrite it or not. Also check when suspending, calling a shell (command), and un-hiding a buffer, and give a warning message if it has changed. |timestamp| Added filename argument for ":buffer" and ":sbuffer". Allow an incomplete specification, jump to the buffer where the name matches, unless there are several matches. |:buffer| When there is an argument list and we are not really editing the 3rd file in it, display "((3) of 5)" instead of "(3 of 5)". Added termcap options for "da" and "db". On terminals that have "da", scroll reverse moves lines from above down onto the screen; on terminals that have "db", deleting a line moves lines from below onto the screen. These lines need to be cleared. |t_da| |t_db| Added termcap options for "cd", clear until end of display. Works faster than repeating "ce", clear to end of line. |t_cd| When changing the terminal name, restore the title and other things before clearing the terminal codes, and set them back after setting the new codes. Don't clear the screen if stderr is redirected for filter command. Don't give message for writing or reading the temporary file for a filter command (unless there is an error). |:!| When reading a file, also set the no-end-of-line when not in binary mode. When 'binary' is set later and the file is written, the end-of-line is not written. Helps when having an autocommand to gunzip "*.gz" files. |'binary'| |'eol'| Unix: Allow reading from fifos (named pipes) and sockets. Give a message when doing it. Added modifiers for '%' and '#' on the command-line: ":p" for path, ":e" for extension, etc. |::p| When replacing '%', '#', etc. on the command-line, do wildcard expansion if there were any wildcards before replacing. Makes ":so `macros_file %` work. But for ":e %" no expansion is done, in case the current file name contains a wildcard. |:_%| MS-DOS and Win32: When $VIM is not defined, use $HOME. |'helpfile'| When replacing home directory with "~", and it's not followed by anything, make it "~/". Looks more like a path name and can't be confused with "~" for 'backupext'. |home_replace| Added 'aleph', 'hkmap', and 'rightleft' options. Can be used to edit text that is written from right to left (e.g., Hebrew). Improvement above reverse insert. Only when RIGHTLEFT is defined at compile time. |vim_rlh.txt| Added extra flag 'm' to 'cpoptions'. If included, typing does not interrupt a 'showmatch' delay, like Vi. By default it is not included; when a character is typed, the showmatch is aborted. |'showmatch'| Line number of ruler is zero when buffer is empty. Makes it possible to see the difference between an empty buffer and a buffer with a single line in it. Column number of ruler is zero when line is empty. Makes is possible to see the difference between an empty line and a line with a single space in it. |'ruler'| When trying to quit Vim while there is a modified, hidden buffer, make that buffer the current buffer. Helps the user to decide to use "q!" or ":wq". |hidden_quit| Added Shift-Tab for command line completion: Works like CTRL-P. It works for Amiga, MS-DOS, and Win32. |c_| When trying to open a ".vimrc" file and it fails, try opening "_vimrc". Also the other way around. This helps for OS/2, Win32, and combined Unix/DOS machines. When doing ":wn" or 'autowrite' is on, there are two file messages, but it's not clear which is for writing. Added "written" to message for writing. Also helps to avoid confusion when appending to a file. Can be made shorter with 'w' and 'W' flags in 'shortmess'. VI COMPATIBILITY IMPROVEMENTS *vi_compat* ============================= Added "\?", "\/", and "\&" to Ex address parsing; use previous search or substitute pattern. |:range| Set alternate file name for ":file fname" command. |:file_f| When using "D" in an empty line, give beep. |D| Accept CTRL-Q in Insert mode and command-line mode like CTRL-V. |i_CTRL-Q| |c_CTRL-Q| Added "-R" Vim argument: readonly mode. |-R| Added "-L" Vim argument, same as "-r", do recovery. |-L| Don't set 'readonly' for each file in readonlymode. |'readonly'| "Vim +/pat file" now finds pat in line 1. |-+/| Quit readonly mode when the 'readonly' option is reset in any buffer. |'readonly'| Made ":|" print current line (used to do nothing). |:bar| Fixed: ":@r" only executed the first line as an Ex command, following lines in normal mode. For ":@r", when register "r" is not linewise, add a return anyway (only when 'cpoptions contains 'e'). |:@| Implemented "-w{number}" Vim argument. It is ignored (Vi sets the 'window' option to {number}). |-w_nr| When using ":wq" after the message "No lines in buffer", an empty file is created (used to be a file with a single newline). Allow writing a readonly buffer with ":wq file". |:wq| Allow range for ":xit", ":exit", and ":wq". |:xit| |:wq| Added ":open" command (not supported), to make ":o" not be recognized as ":only". |:open| Also set previous context mark when moving within the line (but not when not moving the cursor at all). Makes the mapping "map 0 my^V|mzl$`z`y``" work. |''| Added 'cpoptions': flags that influence the Vi-compatible behaviour. This includes a flag that switches on the display of a dollar sign for a change within one line, without updating screen but putting a '$' a the end of the changed text. |'cpoptions'| Only when 'f' flag is present in 'cpoptions' is the file name for a ":read" command used to set the name of the current buffer, if it didn't have a name yet. Likewise for the 'F' flag and ":write". In replace mode, NL does not replace a character but is inserted. Fixed 'r'. It didn't delete a character. Now also made replace with a newline and a count Vi-compatible: only one newline is inserted. Fixed moving marks with the ":move" command. |:move| Allow ';' after search command, e.g., "/pat/;?foo". |//;| Made work like "1|" instead of "0": makes the cursor stick in column 1 when moving up/down. || "O" in an empty buffer now inserts a new line as it should. ":0r file" in an empty file appends an empty line after the file, just like Vi. |:read| "dd" deletes a single, empty line in the buffer, making the buffer empty. In an Ex address, the '+' character is not required before a number, ".2d" is the same as ".+2d", "1copy 2 3 4" is the same as "1copy 2+3+4". |:range| An ESC in normal mode does not flush the map buffer, only beeps. Makes ":map g axx^[^[ayy^[" work. After undo, put cursor on first non-white instead of in column 0. Put cursor on first non-white after a few Ex commands and after "2>>". |u| |>>| The commands ":print", ":number", and ":list" did not leave the cursor on the last line. Fixed "vim -c '/return' -t main" not working. Now the tag is jumped to before executing the "-c" command. |-c| |-t| In a search pattern, '*' is not magic when used as the first character. |search_pattern| Made searching a bit more Vi-compatible. Fixed search for "/.*p" advancing only one character at a time instead of jumping to after the 'p'. "abababababab" only gets three matches for "/abab", instead of five. When 'c' is not present in 'cpoptions', the Vim version 3.0 way is used. |'cpo'| When writing part of the buffer to the current file, '!' is required. Could accidentally destroy the file when giving a line range or when Visual was active while doing ":w". Error message when trying "1,10w"; now it is "Use ! to write partial buffer". It is also given when the current file does not exist yet. |:w!| "r" now sets the last inserted text. |r| Allow "map a ab", head recursive mapping (just like Vi). |recursive_mapping| Remove trailing spaces for Ex commands that accept a "+command" argument, when it is not followed by another command; e.g., when using ":e file ". |:+cmd| Fixed CTRL-V's not being removed from argument to ":map". |:map| Made "|" exclusive. |bar| Doing "%" on an empty line now beeps. |%| Changed "No lines in buffer" from error message into normal message. This is not Vi-compatible (let's call it a negative compatibility improvement), but it works more like one would expect. Fixed removing not enough backslashes and too many CTRL-V's from filenames. |:filename| When command line causes an error, don't execute the next command after '|'. |:bar| When starting to edit a new file, put cursor on first non-blank of line, instead of column 1. Changed CTRL-D and CTRL-U to scroll a certain amount of screen lines instead of physical lines (makes a difference with wrapping lines). Changed the cursor positioning for CTRL-U and CTRL-D when lines wrap. The cursor is now kept a fixed number of FILE lines from the start of the window, instead of SCREEN lines. This should make CTRL-U followed by CTRL-D make the cursor return to the same line in most cases (but not always). Made CTRL-U on first line and CTRL-D on last line in buffer produce a beep and not do anything. This is Vi-compatible. |CTRL-D| |CTRL-U| Added support for abbreviations that end in a non-keyword character. |abbreviations| When 'formatoptions' option is set to "vt", formatting is done Vi-compatibly. |fo_table| When COMPATIBLE is defined when compiling, 'modeline' is off by default. Made the use of modelines a bit more Vi-compatible: There must be white space before "ex:". When using "vi:set " there must be a terminating ':'. |modeline| Fixed Vi incompatibility: "ou" didn't put the cursor back where it was before. "Ou" is still incompatible, this is considered a bug in Vi, because it puts the cursor on another line. |u| Made "zz" at end of file also put cursor in middle of window, making some "~" lines visible. |zz| Fixed files being written when 'autowrite' is on and a filter command is used. |'autowrite'| Screen updating for "J" improved a bit. Was clearing the cursor line instead of the next line. Looks smoother now. For ":sleep" command: place the displayed cursor at actual cursor position. Removed restriction on number of screen columns (MAX_COLUMNS). It was not used for anything. When using a substitute command in a ":global" command, summarise the number of substitutions once, instead of giving a message for each line. Fixed: The ":global" command could set a mark in the jumplist for every matching line. Now only set the previous context mark once. Also makes ":g/pat/s//foo/" run quite a bit faster. ":global" didn't stop at an error message, e.g., from ":g/pat/s//asd/p". Now it stops at the first error message. When the 'x' flag is present in 'cpoptions', typing on the command-line executes it, instead of abandoning it. Added 'p' flag to ":substitute", print last line with substitution. Fixed: ":0;/that/" should not set previous context mark. Fixed: ":r file" should put cursor on first non-blank. Adjusted default for 'history' when COMPATIBLE defined. Adjusted setting of 'iskeyword' when 'compatible' is set or COMPATIBLE defined. Fixed: ":set paste all" should also recognize "all". Fixed: Vi allows for a ':' between the range and an Ex command. Fixed Vi incompatibility: A shell command ":!ls" can be followed by a newline and another Ex command; e.g., ":!ls^@p" (Where ^@ is entered as . Don't do this when there is a backslash before the newline. Filter command didn't put cursor on first non-blank after filtering. Don't skip spaces when using ":!! -x". "r!ls" didn't set the previous "!" command. Now ":r!!" also works. Fixed: Only one '!' argument to a ":!" command was expanded. Now this is Vi compatible. The '!' can be escaped with a backslash. Added '!' flag to 'cpoptions'. When present, a shell command ":!cmd" sets the function to use for redoing a filter command with ".". Fixed: "dfYfX.;" did put cursor on "Y" instead of "X". Don't set last searched character when redo-ing a command. Fixed: "/pat" ":s//foo" should use "pat" for search pattern. It's hard to find out how Vi works... Added 'tag' as a short name for the 'tags' option (Vi compatible). Added 'ed' abbreviation for 'edcompatible' option, 'scr' for 'scroll', 'tty' for 'ttytype', 'wi' for 'window', 'to' for 'timeout' (Vi has them too). Added: 'tagstack' ('tgst') option. It's hidden (Vi: enable tag stack). Fixed: 'ttytype' option works like an alias for 'term'. BUG FIXES *bug_fixes* ========= Changed method to save characters for BS in replace mode. Now works correctly also when 'et' set and entering a TAB, replacing with CR several times, with keyword completion and when deleting a NL where spaces have been deleted. Fixed an occasional core dump when using ^P or ^N in Insert mode under certain conditions. Fixed ":s/\(.*\)/\1/"; was replacing any with line break. Fixed line being printed when there is a '|' after a ":s" command, e.g., ":%s/a/b/g|%s/b/c/g" printed the last line where an 'a' is replaced by a 'b'. Don't map the key for the y/n question for the ":s///c" command. Fixed bug where inserting a new-line before a line starting with 'if', etc. would cause a smart-indent because of that 'if'. Doing CTRL-@ when there was no inserted text yet didn't quit Insert mode. Fixed bug where nowrap was set and doing 'j' or 'k' caused a sideways scroll with the cursor still in the middle of the screen. Happened when moving from a line with few tabs to a line with many tabs. When CTRL-T fails (e.g., when buffer was changed), don't change position in tag stack. If file system full and write to swap file failed, was getting error message for lnum > line_count (with ":preserve"). Fixed cursor not visible when doing CTRL-Z for some versions of Unix (White). Fixed problem with "CTRL-O ." in Insert mode when repeated command also involves Insert mode. Fixed "line count wrong" error with undo that deletes the first line. After undo, "''" puts the cursor back to where it was before the undo. Inserting a tab with 'et' set did not work correctly when there was a real tab in front of it (Brown). Fixed core dump when using CTRL-W ] twice (tag stack was invalid). Fixed overwriting "at top of tag stack" error message. Only show file message for a tag when it is in another file. Added '~' to the special characters for tag search patterns. A tag with a '~' in the search command is now correctly executed. Fixed '^' recognized as start of line in "/[ ^I]^". 'wrapmargin' is restored to its previous value when 'paste' is reset. When 'paste' is set, behave as if 'formatoptions' is empty. Fixed '^' appearing in first window when CTRL-V entered in second window on same buffer. Fixed using count to reselect Visual area when area was one line. Fixed setting curswant properly after Visual selection. Fixed problem that column number was ridiculous when using "V" with ":". After truncating an autoindent, leave curswant after the indent. Fixed ":n #"; put the cursor on the right line like ":e #". Recompute column for shown command when rearranging windows. Check screen size after Vim has been suspended. When creating a new buffer, set 'readonly' to false by default. Fixes getting an empty readonly buffer after ":new" in a readonly buffer. Fixed outputting meta characters (esp. meta-space) when switching highlighting on/off. Added file-number argument to getfile() and do_ecmd() to be able to edit a specific buffer. Fixes problem with CTRL-^ to buffer without a file name. With ":file name" command, update status lines for new file name. When recovering, "Original file may have been changed" message was overwritten. Also changed it into an error message and don't wait for return after "using swap file" message. Fixed core dump when using commands like ":swap" in vimrc file. Fixed "more" for :global command. Don't accept ":g", global command without any argument. Fixed bug: When setting 'history' to 0 (happens when setting 'compatible') there could be a crash or a hang (only when 'viminfo' didn't include lines in history). After using ":set invlist", cursor would not stick to the column. Fixed problem of trailing 'q' with executing recorded buffer when 'sc' set. Remove the character(s) that stopped recording from the register (normally 'q', but can be more when using a mapping for 'q'). MS-DOS: Replace call to delay() by loop around biostime(). Fixes problem with mouse crawling under Windows 95. Fixed CTRL-Z not working for Apollos. Fixed cursor not ending on right character when doing CTRL-T or CTRL-D in the indent in Insert mode. When 'columns' was set to zero, core dump or hang might happen. Fixed message from ":cn" being deleted by screen redraw. Fixed window resizing causing trouble while waiting for "-- more --" message. Don't wait for a return after abandoning the command-line. Fixed extra wait_return() after error message on starting up. Fixed matching braces inside quotes for "%". Fixed "illegal line number" error when doing ":e!" after adding some lines at the end of the file. Fixed ":map #1 :help" not working. Fixed abbreviations not working properly. Fixed calling free() in buf_write() when smallbuf[] is used: could cause big problems when almost out of memory. Removed double redraw when returning from ":stop" command. After recovering there was one extra empty line at the end. Fixed core dump when reporting number of buffers deleted. Fixed core dump when deleting the current buffer. Fixed cursor in wrong position after ":set invwrap" and cursor was below a long line. Fixed ":split file" causing a "hit return" message. Fixed core dump when screen is made bigger while in --more-- mode. Fixed "@:" executing last Ex command without prepending ":". Made Visual reselect work after "J" command. Fixed problem that 'showcmd' would cause mappings to happen in the wrong mode. e.g., ":map g 1G^M:sleep 3^M:g" would show ":1G". Fixed problem when mapping ends in a character that start a key code; would wait for other characters for each character. The number of lines reported when starting to edit a file was one too much. Fixed problem that in some situations the screen would be scrolled up at every message and when typing on the command-line. Removed the screenclear() calls for MS-DOS in fileio.c; some messages got lost by it. Just use CTRL-L to redraw the screen in the rare case that you get the "insert disk b: in drive a:" message. When doing ":/pat/p" on the last line without 'wrapscan' set, used to start in line 1 anyway. Now an error message is given and the command aborted. Don't display "search hit bot" message twice for ":/pat/p" and overwrite it with any error message. When an error was detected in an Ex address (e.g., pattern not found), the command was executed anyway; now it is aborted. Fixed problem that after using Visual block mode, any yank, delete, and tilde commands would still use the Visual coordinates. Added "block_mode" variable. Fixed not always redrawing correctly with ":unhide" command. For Unix: Give error message when more than one file name given to Ex commands that accept only one. Fixed: When "+command" argument given to Ex command, wildcards in file name after it were not correctly expanded. Changed most calls to outstr() into msg_outstr(); makes screen output correct for some cases; e.g., when using "!!cp file", the message for reading the temporary file was messed up. When out of memory because undo is impossible, and 'y' is typed in answer to the 'continue anyway' question, don't flush buffers (makes Maze macros work on MS-DOS). Sometimes mappings would not be recognized, because the wrong flags in noremapstr[] were checked. Fixed problem with handling concatenated commands after expanding wildcards, e.g., with ":e bu*c|ls". Fixed problem with argument like '#' to a command like ":wnext" causing the command not to do the right thing, depending on the file name. Display file names with msg_outtrans(); control characters will be shown. Also use transchar() for setting the window title and icon. Fixed not resetting the yankbuffer when operator fails or is cancelled with ESC (e.g., using "p" after ""ad" would still use register 'a'. When "[[" or "]]" is used without an operator, put cursor on begin of line. Adjust Insstart when using CTRL-T and CTRL-D in Insert mode; would not be able to backspace over some characters. ":unhide" could redisplay some buffers at the wrong position; added call to cursupdate() to enter_buffer(). Fixed freeing memory twice when opening of memfile fails. After "z.", screen was displayed one line down compared to other positioning. Fixed "%<" and "#<" in the command line not working. Fixed two bugs in "2cc". The auto-indent was taken from the last line instead of the first. When the cursor was on the last character in the line, it would be positioned on the first char of the next line. Fixed bug with doing "cc" on last few lines of the file; would delete wrong line. Fixed problem with formatting when char in column to break is a CTRL-M. Replaced isspace() by iswhite(). Call starttermcap() in wait_return() only when redraw is done. Moved calling starttermcap() to avoid switching screens before calling wait_return(). Fixed calling wait_return() on the wrong screen if T_KS switches between two screens. Would hide the result of commands like ":!ls". Fixed screen not being updated when a command typed in response to wait_return(). Don't update screen when '/' or '?' typed, just like with ':'. Fixed extra call to wait_return() when hitting "/". When splitting window, don't copy scroll option from other window; avoids "invalid scroll size" error message. Adjusting marks for undo/redo was one line off. Fixed extra space after cursor in Insert mode when 'wrap' is off and the cursor is at the end of the line. Fixed bug: In some cases with multiple windows, the 'tabstop' and 'list' option of the wrong window would be used. Fixed problem with char_avail() causing real_State to have the wrong value, causing u_sync() to be called while in Insert mode, causing undo not to function correctly. Fixed horizontal scrolling not working properly when 'number' option set. Fixed bug with automatic formatting: wouldn't wrap when there was only a single non-blank in the first column. Fixed problem of displaying the inverted area for Visual block mode. Happens when moving up-down stays in the same column in the line but the screen column changes (e.g., when moving over a TAB). Delete temp files from filter command when writing to the temp file fails. When not being able to read the input in unix.c, could get an unexpected exit. Added retry for 100 times and flush files before exit. Fixed redisplaying problem: When ":" hit in wait_return(), a window would be redrawn if it has the current buffer but is not the current window. This would result in the output of the ":" command being overwritten. Don't give error messages for setting terminal options in vimrc for "vim -r". When doing "2CTRL-^" if current buffer is 2, don't do anything (used to move the cursor to another line). Fixed horizontal scrolling problem with ":set nowrap ss=1 nu". Fixed undo not working when using CTRL-V in Insert mode and automatic wrapping occurs. When setting terminal to raw mode, always do it. Always set terminal to raw mode after executing an external program. Fixes problem when external program unexpectedly switches terminal to cooked mode. When terminal is in not-raw mode, don't set it again, it causes problems. ":[range]yank" moved the cursor; now it leaves it where it was. When undoing ":[range]d", ":[range]>", or ":[range]<", put cursor on first undone line. Fixed abbreviations behaving tail-recursively. Fixed abbreviations being applied while inserting a register in Insert mode with CTRL-R. Fixed "-- INSERT --" message being deleted when entering CTRL-R ESC in Insert mode. Fixed bug when 'showmode' on: When using CTRL-E in Visual mode the message was deleted one out of two times. Corrected use of CTRL-@ (NUL) in cmdline editing: Inserted a NL, now K_ZERO. Fixed messages for CTRL-O in Insert mode; error messages for "CTRL-O :" were overwritten. Fixed wait-for-return when executing a filter command when 'autowrite' is set. Don't redisplay the filter command, as it will be overwritten anyway. When there is no file name and executing a filter command, don't use the file name of the temporary file for the current file. Fixed ":!!" not working. Discovered that some versions of strchr() and strrchr() can't handle characters above 127. Made a Vim version of these functions. Fixes problems with special keys and mouse with DJGPP. For DJGPP use _dos_commit() instead of dup()/close(). Removed the define VIM_ISSPACE, added vim_isspace(), which is always used. It's not worth risking trying the compiler's isspace(). Removed NO_FREE_NULL defined, always use vim_free() instead of free(). There's no need to take a risk by assuming that free() can handle NULL pointers. Fixed not accepting '!' with ":file". Fixed 'shortmess' set to 1 if setting file name would fail. Fixed: When Visual block mode started on an empty line, the block was always at least two characters wide. Fixed: Doing "*" on a special character (e.g., CTRL-K) would not work. Renamed variable names that are keywords for some compilers: "new", "old", "delete", and "class". Fixed a few screen redisplay bugs: When opening a new line with "o" on the last-but-one line in the last-but-one window, the next window would be scrolled down one line. When appending a character to the last line on the screen, it would not get updated until after the second character typed. When deleting the last line in a window, the windows below it (or the status line) would get scrolled up. Fixed bug: Screen was scrolled two lines instead of one when cursor was moved to one line above the top line (with 'so' = 0 and 'sj' = 0). Fixed: ":mkexrc" didn't handle special keys in mappings correctly. Add "version 4.0" to the start of the file generated with ":mkvimrc". Add a backslash before a '"' for ":mkexrc" and ":mkvimrc". Don't write 'endofline', 'scroll', and 'ttyfast' with ":mkvimrc" or ":mkexrc". Fixed: ":mkvimrc" must put a backslash before a backslash for options values. A mapping that contains a didn't work properly, now the "" is used instead of a CTRL-V before the end of the line. An option that contains a needs a backslash. Fixed other windows on the current buffer not being updated if undo resulted in an unmodified buffer. Fixed: When inserting chars in the last line on the screen, making it too long to fit on the screen, it made the line disappear for a moment. Fixed display not being redrawn at cursor position with ":buf 1". Fixed putting a blank instead of a reversed blank between the file name and the ruler in the status line when the file name was truncated. Fixed: When doing "vlllu" with 'showcmd', the "-- VISUAL --" message would not be deleted. Give error message if lalloc() is called with a size <= 0. If a mapping contains a CTRL-V in "from" or "to" part, don't interpret the following bytes as terminal codes. Makes mapping ":map q :s/hi ^V^V^H" work. Unix: Fixed problem where an invalid setting for WINDOWID would cause Vim to exit immediately. Unix: Re-open stdout and stderr when executing a shell for command-line completion. Makes it work on Alphas and with bash. Fixed problem with scrolling for hpterm (scroll reverse doesn't work as expected). Fixed bug: ":d 2" on last line in buffer gave "ml_get: invalid lnum" errors and undo didn't work correctly. Unix: When termio.h and termios.h are both present, use termios.h. Message "[no write since last change]" for shell command was not put in column 1. Fixed bug: "Hit return to ..." message was overwriting the output of a shell command when 'cmdheight' was bigger than 2. Unix: Use utsname() if it is present for mch_get_host_name(). Fixed "?pat?e", "/pat/s-2", and "?pat?e+2" getting stuck on a match. Only for Unix is the short file name used for reading/writing the file when ":cd" has not been used. On MS-DOS and Win32, a "cd" in a sub-shell also changes the current directory for Vim, which causes the file to be written in the wrong directory. Fixed not removing the highlighted area when a buffer has several windows with "v...y". Made it possible to set number options to a negative number (for 'undolevels'). Fixed hang in Insert mode for using cursor keys that start with ESC with a slow terminal, caused by using read with zero length. Fixed a CTRL-W in Insert mode on the last line of the window causing a scroll-up. MS-DOS: Fixed a bug in msdos.c that wrote over the end of allocated memory when expanding file names; could cause all kinds of problems. Amiga: Sort each wildcard component separately, not all together. Fixed serious performance problem: When abandoning a file, the freed memfile blocks were not counted, causing all blocks to be flushed to disk after abandoning more than 2Mb worth of files. Fixed one-second delay between "Unknown options" and ": opt" for autocommand errors. After doing ":set term=name", output t_me and redraw the screen; makes any new color settings work (just hitting CTRL-L doesn't do this). When 'updatecount' was set to zero, every character typed would cause a sync(), instead of not syncing at all. Fixed display not updating correctly when joining lines, e.g., "v11jJ". With ":join", leave cursor on first non-blank in the line. Use #define SIZEOF_INT instead of sizeof(int) in fileio.c; avoids warning "statement not reached" for some compilers. Fixed obscure hang in mch_inchar() in unix.c. Added a set of digraphs for HPUX. When quickfix does not find a complete match, reset the line number to 0; avoid a jump to a line that could have been any number in the output of the 'makeprg'. Fixed operator with "}", when end is on last line in the file and it's empty. The last line was included instead of excluded. Fixed bug: When ":g/pat/d" resulted in an empty file, undo only put one line back! Could happen with many other operations that result in an empty file. Changed exit status when shell cannot be executed from 127 to 122, some shells (bash) are already using 127. Makes error message "cannot execute shell" disappear when in fact the command could not be executed, e.g., for ":!burp". When there is no file name and executing a filter command, don't use the file name of the temporary file for the current file. Fixed "w" on last char in the file (not being an empty line) not beeping. Fixed cursor not being positioned correctly, when resizing the window in Normal mode and the cursor is on a TAB. Give beep when trying to use "I" after an operator, without first moving the cursor to the start of the line. When listing options, check length of number options too, 'maxmapdepth' set to 9999999 would show 999999. Also account for replacing the home directory when checking the length of expandable string options. 'showmatch': Only show match when visible, not when 'wrap' off and match is left or right of the screen. Fixed: Message "freeing N lines" would cause a hit-return message when an (error) message has been given before it. Fixed bug: "(" would get stuck at a line ending in ".}". "]" after line end was not recognized. Fixed reported problem with MS-DOS and Amiga when using more than 32000 lines; replaced int with long in memline.c. Fixed problem when using a negative count to a quickfix command, e.g., ":cn -1". Give error message when extra argument given for ":cnext", ":cprevious", or ":cc". "@%" and "@." used register 0. Now "@%" gives an error message and "@." correctly executes the previously inserted text. Fixed: "|j" moved cursor to last char in the line. Fixed bug for MS-DOS: Expanding "~3" would make Vim hang. When 'insertmode' set, don't give the warning "changing a readonly file" when entering insert mode, but only when actually changing something. Made deleting with "D" more efficient. Was deleting one character at a time, which is very slow for long lines. When using the "-oN" command line option, make windows equal height after loading the buffers. "vim -o5 *.h" looked weird. When there is no file name, ":rew", ":next", and others gave misleading error message. Fixed: When deleting text, start pos in col 0 and end pos in col 0, with last character included, the yank became linewise. This should not be done when the movement is inclusive. Changed: Only give "output not to a terminal" message when going to do something full screen. Don't ask to hit return for GUI help when output doesn't come from or go to a terminal (for "vim -h | more"). Fixed: CTRL-Z/fg made windows equal height; should only be done when the window height has changed. Give error message for ":set tw=0,wrap"! When checking for an existing file, don't use fopen(fname, "r"), but stat(). It's a bit faster and more reliable (e.g., when the file exists but it does not have read permission). When reading a script file, undo undoes everything that the script did (after starting to edit the current file). Command line completion: just after non-alphabetic commands now expands like there was a space after the command (e.g., :!). Unix: Don't accept expanded file names that don't exist. Helps when using /bin/sh (would expand "foo" to "foo\*"). Fixed: ":recover" didn't work correctly when cursor was not on line 1. Also: Don't clear the current buffer when ":recover" runs into an error that prevents recovering (e.g., when .swp file is empty). Unix: When executing a filter command, switch terminal to cooked mode. This makes it possible that the filter can be killed with CTRL-C. You might lose typeahead on some systems. When using CTRL-G in visual mode, show the file message until a key is hit. Would be overwritten with the mode message immediately. Fixed: ":unabbreviate" was before ":undo", should be the other way around, because ":u" and ":un" mean ":undo". Fixed: When using CTRL-L on the command line and there are several matches, beep_flush() would be called, causing any mapped characters to be flushed. This breaks the mapping ":cmap ^X ^L^D", that simulates tcsh's autolist completion. Fixed: Could enter numbers larger than 255 with CTRL-V{digits}. Entering CTRL-V256 would cause a crash a little later. When writing a file with ":w!", always reset the 'readonly' option, not only for Unix and not only when the file is not writable. Changed error message when trying to write a buffer with 'readonly' set to "'readonly' option is set (use ! to override)". Fixed: "gf" did an autowrite, even though no valid file name was found. Fixed: ":so! $VAR/file" didn't work, although ":so $VAR/file" works. Fixed: Putting non-alpha garbage after an option name in a ":set" command wasn't recognized; e.g., with ":set ts-8". Fixed: Would use NULL pointer in out-of-memory situtations in mf_alloc_bhdr(). vim:ts=8:sw=8:js:tw=78: