Welcome to Vim Version 4.0!


This document lists the differences between Vim 3.0 and Vim 4.0. See vim_diff.html for a short overview.

CONTENTS

  1. VERSION WARNING MESSAGE
  2. INCOMPATIBLE CHANGES
    1. 'backup' option default changed
    2. Extension for backup file changed
    3. Structure of swap file changed
    4. Backspace and Delete keys
    5. Escape for | changed
    6. Key codes changed
    7. Terminal options changed
    8. 'errorformat' option changed
    9. 'graphic' option gone
    10. 'yankendofline' option gone
    11. 'icon' and 'title' default value changed
    12. 'highlight' option changed
    13. Use of "v", "V" and "CTRL-V" in Visual mode
    14. CTRL-B in Insert mode removed
  3. NEW AND IMPROVED FEATURES
    1. New on-line help system
    2. Tag support improved
    3. Command line editing improvements
    4. Improved indenting for C programs
    5. Searching for words in include files
    6. Word completion in Insert mode
    7. Automatic commands
    8. Options
    9. Support for editing one-line paragraphs
    10. Usage of key names
    11. Viminfo
    12. Compilation improvements
    13. Improved (error) messages
    14. Swap file
    15. Mouse support
    16. Graphical User Interface (GUI)
    17. Support for Windows 95/NT
    18. Miscellaneous
  4. VI COMPATIBILITY IMPROVEMENTS
  5. BUG FIXES

VERSION WARNING MESSAGE

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

But read the information below first!

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

The default value for 'backup' used to be on. This resulted in a backup file to be 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.

Extension for backup file changed

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 of "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
Structure of swap file changed
The contents of the swap file was extended with several parameters. Vim will store the user name and other information of 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

Backspace and Delete keys

In 3.0 both the delete and the backspace key worked as a backspace in insert mode, they deleted the character 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' set two lines are joined. See <Del> i_<Del>

In 3.0 the backspace key was always defined as CTRL-H, delete as CTRL-?. In 4.0 the code for the backspace and delete key is obtained from the termcap/termlib, and adjusted for the "stty erase" value on Unix. This helps people that define the erase character depending on the keyboard they are working on. See <BS> i_<BS>

If you prefer backspace and delete in Insert mode to have the old behaviour, put this line in your .vimrc:

inoremap ^? ^H
And maybe you also want to add these, to fix the value for <BS> and <Del>:

set t_kb=^H
set t_kD=^?

(enter ^H with CTRL-V CTRL-H and ^? with CTRL-V CTRL-? or <Del>)

If the value for t_kb is correct, but the t_kD value 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.

When ^H is not recognized as <BS> or <Del>, it is used like a backspace.

Escape for | changed

When the 'b' flag is present in 'cpoptions', in mapping and abbreviate commands the backslash cannot be used to escape '|', 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

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 for a character. See 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 ASCII representation for this in <>. Use the table below. It also lists the old name, as it was used in the documentation.

old namenew nameold hex codeold dec codeold MSDOS hex codeold MSDOS dec code
<ESC><Esc>
<TAB><Tab>
<LF><NL>
<NewLine>
<LineFeed>
<SPACE><Space>
<NUL><Nul>
<BELL><Bell>
<BS><BS> <BackSpace>
<INSERT><Insert>
<DEL><Del> <Delete>
<HOME><Home>
<END><End>
<PAGE_UP><PageUp>
<PAGE_DOWN><PageDown>
<C_UP><Up>0x801280xb0176
<C_DOWN><Down>0x811290xb1177
<C_LEFT><Left>0x821300xb2178
<C_RIGHT><Right>0x831310xb3179
<SC_UP><S-Up>0x841320xb4180
<SC_DOWN><S-Down>0x851330xb5181
<SC_LEFT><S-Left>0x861340xb6182
<SC_RIGHT><S-Right>0x871350xb7183
<F1><F1>0x881360xb8184
<F2><F2>0x891370xb9185
<F3><F3>0x8a1380xba186
<F4><F4>0x8b1390xbb187
<F5><F5>0x8c1400xbc188
<F6><F6>0x8d1410xbd189
<F7><F7>0x8e1420xbe190
<F8><F8>0x8f1430xbf191
<F9><F9>0x901440xc0192
<F10><F10>0x911450xc1193
<SF1><S-F1>0x921460xc2194
<SF2><S-F2>0x931470xc3195
<SF3><S-F3>0x941480xc4196
<SF4><S-F4>0x951490xc5197
<SF5><S-F5>0x961500xc6198
<SF6><S-F6>0x971510xc7199
<SF7><S-F7>0x981520xc8200
<SF8><S-F8>0x991530xc9201
<SF9><S-F9>0x9a1540xca202
<SF10><S-F10>0x9b1550xcb203
<HELP><Help>0x9c1560xcc204
<UNDO><Undo>0x9d1570xcd205
(not used)0x9e1580xce206
(not used)0x9f1590xcf207
Terminal options 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 had a termcap entry that was wrong or incomplete, or you have set the highlight options to a different value.

Note that for some keys there is no termcap name. Use the <> type of name instead. That is a good idea anyway.

Note that "t_ti" became "t_mr" (invert/reverse output) and "t_ts" became "t_ti" (init terminal mode). Be careful when you use "t_ti"!
old namenew namemeaning
t_cdlt_DLdelete number of lines
t_cit_vicursor invisible
t_cilt_ALinsert number of lines
t_cmt_cmmove cursor
t_crit_RIcursor number of chars right
t_cvt_vecursor visible
t_cvvt_vscursor very visible
t_dlt_dldelete line
t_cst_csscroll region
t_edt_clclear display
t_elt_ceclear line
t_ilt_alinsert line
t_dadisplay may be retained above the screen
t_dbdisplay may be retained below the screen
t_ket_keput terminal out of keypad transmit mode
t_kst_ksput terminal in keypad transmit mode
t_mst_mssave to move cursor in highlight mode
t_set_senormal mode (undo t_so)
t_sot_soshift out (standout) mode
t_tit_mrreverse highlight
t_tbt_mdbold mode
t_tpt_mehighlight end
t_srt_srscroll reverse
t_tet_teout of termcap mode
t_tst_tiinto termcap mode
t_vbt_vbvisual bell
t_csct_CScursor is relative to scroll region

t_ku t_ku<Up>arrow up
t_kd t_kd<Down>arrow down
t_kr t_kr<Right>arrow right
t_kl t_kl<Left>arrow left
t_sku<S-Up>shifted arrow up
t_skd<S-Down>shifted arrow down
t_skr t_%i<S-Right>shifted arrow right
t_skl t_#4<S-Left>shifted arrow left
t_f1 t_k1<F1>function key 1
t_f2 t_k2<F2>function key 2
t_f3 t_k3<F3>function key 3
t_f4 t_k4<F4>function key 4
t_f5 t_k5<F5>function key 5
t_f6 t_k6<F6>function key 6
t_f7 t_k7<F7>function key 7
t_f8 t_k8<F8>function key 8
t_f9 t_k9<F9>function key 9
t_f10 t_k;<F10>function key 10
t_sf1<S-F1>shifted function key 1
t_sf2<S-F2>shifted function key 2
t_sf3<S-F3>shifted function key 3
t_sf4<S-F4>shifted function key 4
t_sf5<S-F5>shifted function key 5
t_sf6<S-F6>shifted function key 6
t_sf7<S-F7>shifted function key 7
t_sf8<S-F8>shifted function key 8
t_sf9<S-F9>shifted function key 9
t_sf10<S-F10>shifted function key 10
t_help t_%1<Help>help key
t_undo t_&8<Undo>undo key

'errorformat' option 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.

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

The 'graphic' option was used to make the characters between <~> and 0xa0 displayed 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.

'yankendofline' option gone
The 'yankendofline' option has been removed. Instead you can just use
:map Y y$
'icon' and 'title' default value 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.

The default for 'icon' now depends on the possibility to restore the original value, just like 'title'. If you don't like your icon titles to be changed, add this line to your .vimrc:

:set noicon

'highlight' option changed
Renamed the 'i' flag from invert to italic highlighting. The 'r' flag is used for reverse highlighting, what 'i' used to be. Normally you won't see the difference, because italic mode is not supported on most terminals and the reverse mode is used then.

When an occasion is not present in 'highlight' use the mode from the default value for 'highlight instead of reverse mode.

Use of "v", "V" and "CTRL-V" in Visual mode

In Visual mode "v", "V" and "CTRL-V" used to end Visual mode. Now this is only done if the Visual mode was in the corresponding type. Otherwise the type of Visual mode is changed. Now only ESC can always be used to end Visual mode without doing anything.

CTRL-B in Insert mode removed

CTRL-B in Insert mode used to toggle the 'revins' option. If you don't know this and accidently 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.

NEW AND IMPROVED FEATURES

New on-line help system

Help is displayed in a window. The usual commands can be used to move around, search for a string, etc.

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. See :help.

Added 'helpheight' option: Minimal height of a new help window.

Made <F1> 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

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 ignoring case.

A few tries are done 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.

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 support 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 with 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 hardly useful.

Added CTRL-] command to Visual mode: :ta to highlighted text (only when not more than one line is highlighted). Same for "K": Use keyword program for highlighted text.

Command line editing improvements

There is no longer one command line history. The search strings are now in a separate list, they can only be accessed when entering a search string.

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 in the history.

For command line history: Exchanged meaning of <Up> and <S-Up> keys, <Down> and <S-Down> 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.

Put all search strings, also from "*" and "#" commands, in the search history.

Added completion of old setting. For example: ":set hf=<Tab>". Makes it possible to change an option without completely retyping it. Backslashes are inserted where necessary.

Fixed commandline completion when in the range.

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 was started is remembered.

Added paging for showing matches on 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.

Improved indenting for C programs

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.

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, the 'comments' and 'nestedcomments' options.

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':

  • When entering '{' indent is not rounded to 'shiftwidth'.
  • When entering '}' and the matching '{' is preceded with a '(', set indent to 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, should make no difference unless you change the 'cinw' option.

Searching for words in include files

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). See include_search

The search can be done for identifiers with "[i" or defines with "[d". Use ":checkpath" to check if include files can be found.

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.

Added ":isearch", ":ilist", ":ijump", ":isplit", ":dsearch, etc. Allows for an identifier to be found that is not in the text yet.

Word completion in Insert mode

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.. See Keyword completion

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 CTRL-X_CTRL-E, and completion can be done is several ways. See Insert mode Completion

Completion can be done from a dictionary, defined with 'dictionary'. This is very useful when typing long words. See 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. See CTRL-X_CTRL-I

There is also completion for whole lines, tags, file names and defines.

Added 'infercase' option. When doing keyword completion in Insert mode, and 'ignorecase' is also on, the case of the match is adjusted.

Automatic commands

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.

Added ":normal[!] {command}", execute Normal mode command from cmdline. Useful for autocommands. Use with care!.

Text objects
After an operator and in Visual mode text object commands can be used to select a word, line or paragraph. See Text object selection.
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

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. See 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. See :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. See :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.

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'.

Added 'scrolloff' option: Make that many lines of context visible around the cursor. If "so=999" cursor line is always in middle of window.

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'.

Implemented incremental search, use 'incsearch' option to switch it on.

Added options for adjusting to character set and characters in identifiers:
'isident' Characters in identifiers
'isprint' Characters that can be displayed directly
'iskeyword' Characters that are in (key)words
'isfname' Characters that can be in a file name
Increased default for 'undolevels' for unix from 100 to 1000.

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".
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.

Changed default for 'keywordprg' to "man", much more useful for most of us. When 'keywordprg' is empty, ":help" is used, get help for word under the cursor.

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.

Added options 'flash' and 'novice', they are not used.

Accept special key sequence, e.g. <Tab>, when setting 'wildchar'. Give error message when setting 'wildchar' option to non-number.

Added types to 'highlight' option:
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
When filtering, use the 'shellredir' option to redirect the output. When possible 'shellredir' is initialized to include stderr.

Moved initialization of 'shellpipe' and 'shellredir' to after other initializations, so that they work correctly when 'shell' option is set.

Added '2' to 'formatoptions' 'Q' will keep the indent of the second line of a paragraph.

Added 'maxmapdepth' option: maximum recursiveness of mapping.

Added 'smartcase' option: Don't ignore case if a typed search pattern contains upper case characters.

Added 'langmap' option, for those that 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.

Changed 'whichwrap' into a string option. When setting it to a number it is automatically converted, for backwards compatibility with 3.0.

Expand environment options for 'term', allows ":set term=$TERM".

Replace 'nobuf' by 'writedelay' ('wd'), time to delay writes by. Makes it possible to reduce the writing speed to almost nothing. 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. When 'bin' option is set, save the values of the options that are set to 0. Restore the values when 'bin is reset. Added 'ttyscroll' option: Maximum number of screen lines to do scroll with. When trying to scroll more lines redraw the window.

Support for editing one-line paragraphs

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!@*-+_;:,./?".

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.

The commands "gk", "gj", "g0", "g^" and "g$" have been added: Move a screen line. They differ from "k", "j", etc. when lines wrap.

Usage of key names

Special keys now all have a name like <Up>, <End>, etc. This name is used for mappings, in listings, and many other things. See key_notation

For keys that don't have a <> name, but do have a termcap name, the <t_xx> form can be used. The "xx" entry from the termcap is used. See terminal_options

Show meta keys in mappings as M-x. Use highlight option '8' for higlighting the meta keys.

Added a few special keys. <PageUp> and <PageDown> work like CTRL-B and CTRL-F. <Home> goes to column one, <End> goes to end of line, in Insert and Normal mode. <Insert> 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.

It is now possible to use both <F11> and <S-F1> (they used to be the same key). See function-key

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.

Compilation improvements

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.

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. I usually do 'make shadow; mv shadow sun4-gcc; cd sun4-gcc; ./configure'

Improved (error) messages

Give error message that includes the commandline for ":" commands that are not typed by the user. Changed "Invalid command" message into "<command>: 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. See 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 when 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.

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.

Improved error message for unrecognized command in .vimrc. Now the whole line is displayed.

When error detected when writing a file, give error message instead of normal message.

Improved error messages for some options: Show character that caused the error.

Completely changed 'showcommmand'. Now also shows parts of mappings, CTRL-V, etc.

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

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).

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".

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. 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.

Improved recovery when there are multiple swap files. You get a choice which one to use. Ignore the swap file from the active editing session. "Vim -r" gives information about date and contents of the swap files. Allow ":recover" without a file name, to recover from ".swp".

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. See 'updatecount'

When looking for swap_files also consider the shortname version. Finds swapfiles on MSDOS file systems.

When encountered a serious error when doing "vim -r file" (like swap file not found or empty swap file), quit Vim.

MSDOS: Always use full path name for swapfile, otherwise it can't be deleted after using ":!cd dir".

Mouse support

The mouse is supported in an xterm and for MS-DOS. This can be controlled with the 'mouse' option. See Using the mouse

The mouse can be used for:

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, MSDOS and xterm.

Graphical User Interface (GUI)
Included support for GUI: menu's, mouse, scrollbars, etc. Currently only with Motif and Athena interface.

Added text register '*' (for text selected in GUI with mouse).

Support for Windows 95/NT
There is now a new version for Windows NT that can also be used for Windows 95. It supports long file names, uses all available memory and many more enhancements.

There is also an MSDOS version that has been compiled with DJGPP. It uses all available memory. It supports long file names when available.

Miscellaneous new features

When using CTRL-A and CTRL-X leading zeros are preserved for octal and hexadecimal numbers.

"%" 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.

Added commands ":ascii" and "ga", show value of character under the cursor in several ways.

Added "gg" command to goto line 1.

Added "gI" command: Start insert in column 1.

Added "g~", "gu" and "gU" operators, change case of selected text.

Added "ge" and "gE", go back to end of word or WORD.

Added "g_CTRL-G": Display info about the position of the cursor. Added virtual column number to 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.

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.

Put character attributes in a separate byte in NextScreen, makes updating of highlighted parts more reliable.

Added column number to ":marks" command. Improved error messages for marks that are unknown, not set or invalid.

Added argument to ":display" and ":marks", show info for the argument.

Added the ":retab" command. Can be used to change the size of a <Tab>, replace spaces with a <Tab> or a <Tab> with spaces.

If VIMINIT is set, but is empty, ignore it.

Added ":ls", synonym for ":files".

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, is like 'y' for all remaining replacements.

For ":s" don't accept digit as separatork, ":s8foo8bar8" doesn't work.

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.

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.

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].

Added CTRL-W_CTRL-^ command: split and edit alternate file.

Implemented "Vim -r" to list any swap files that can be found. In version 3.0 this command used to crash Vim.

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. See 'revins'

The "Q" operator no longer affects empty lines. You can now format a lot of paragraphs without losing the separating blank lines. Use "Qp..." to format a few paragraphs on a row.

After "Q" put cursor at first non-blank of the last formatted line. This makes it more easy to repeat the formatting. Made "Q}" 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.

When formatting with "Q" 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 "Q" command.

Added CTRL-W_CTRL-T (got to top window) and CTRL-W CTRL-B (go to bottom window).

When in Insert mode and wrapping from column one to the last character, don't stick at the end but in the column.

Added "[p" and "]P" as synonym for "[p". These commands are now redoable. Fixed cursor positioning and characterwise text.

Improved the handling of empty lines for "[p" and the like.

Improved ":center", ":right" and ":left"; blank lines are no longer affected, tabs are taken into account, trailing blanks are ignored. See 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.

Added '-' register for deletes of less than one line. See registers.

When :bdelete 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, but buffer names with spaces don't work.

When file name changed, also change name of swap_file. This makes it more easy to find the swap file for recovery.

The Amiga trick for recognizing an MSDOS compatible filesystem is now also done for UNIX. Fixes problems with wrong swap file and backup file name on an MSDOS partition for FreeBSD and Linux. See 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 loosing the original file when trying to write again and overwriting the backup file. See write_fail

If 'backup' is off and 'writebackup' is on: Don't delete an existing backup file, use another file name. See backup_table

When going to another window in Visual_mode: When it is the same buffer, update Visual area, when jumping to another buffer reset 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. See limits

When last file in argument list has been accessed, quit without asking. This works more intuitive when using ":prev". See arglist_quit

Set alternate file name when using buffer commands like ":bmod", ":buf", ":bdel", etc.

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 fails 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 0. Take care of TABS when displaying an error message. Error number or count can also be before :cc, :cp and :cn.

When asked a yes/no question, ESC is the same as 'n'.

Removed a few large arrays from the stack, MSDOS was running out of stack space.

Added ":view file" and ":sview file": start editing a file with 'readonly' set.

Removed restriction on command line length.

When adding a jump to the jumplist, remove older jumps to the same line.

Added highlighting to titles of lists. See 'highlight'

Added separate mapping for normal mode and Visual mode. New commands ":nmap", ":nnoremap", ":nunmap", ":vmap", ":vunmap" and ":vnoremap".

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).

Added "-u vimrc" command line argument: Read initializations only from {vimrc} file and skip the other initializations.

Added "-i viminfo" command line option: Set name for .viminfo file, can also be used to skip reading .viminfo.

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.

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.

When 'wrap' option is off, make sure the whole character under the cursor is on the screen (for TAB and non-printable characters).

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. See 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" command line option: Switch lisp mode on.

MSDOS: Only beep once in a ten times in 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). See 'timeoutlen'

Made "#" and "*" not find the text under the cursor.

Unix: Expand path names starting with "~" to full path names. Makes "gf" work on "~user/path".

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.

When doing ":make" and 'autowrite' is set, write all buffers, not just current one. Just like ":!cmd".

":make" now shows the command that is executed by the shell, including 'shellpipe' and 'errorfile'. Helps to understand how 'shellpipe' is used.

Allow for digraphs to be entered in reverse: Char1-char2 and char2-char1 both work.

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.

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.

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.

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).

Improved screen output. The cursor positioning code is avoided whenever possible. When outputting a char on a next line, column 0, use CR-LF to go there instead of cursor positioning, that is less 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). See t_cs

No longer do home_replace() when it results in just "~", it is 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 the same as for others.

When sourcing a file on MS-DOS and 'textauto' is set, try to recognize non-textmode files by the first line. See :source_crnl

For ":" commands that have one file name argument: Only Unix sees the space as a file name separator, for Amiga, MS-DOS, etc. it 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", when home is "/home/piet", with "~er/file". 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.

Added ":registers" as a synonym for ":display".

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, sun-cmd or iris-ansi, set 'ttyfast' Added builtin termcap entry for iris-ansi. The entry in the termcap is often wrong. See 'term'

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.

When coming back from a CTRL-Z, before setting 'title', store the current title again for restoring later, it might have changed.

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. See :+cmd

Set '[ and '] marks to start and end of undone/redone lines.

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.

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.

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.

Made CTRL-N and CTRL-P for command line completion line cyclic.

"CTRL-V_w" in the command line where a file name is expected is expanded to the current word under the cursor. "CTRL-V W" is expanded to the WORD under the cursor, "CTRL-V p" to the file name under the cursor.

Added character 163 (pound sign on English keyboards) as an alternative for the '#' command.

Added ":cNext" as a nickname for ":cprevious".

Made ":bnext" and ":bNext" wrap around the end of the buffer list.

When a regexp contains a '[' without a matching ']', assume the '[' is a normal character. This makes ":help [" work. See 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. See 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.

Added ":abclear" and ":mapclear": remove all abbreviations/mappings.

MSDOS: For Visual mode, always invert the character under the cursor, also when cursor cannot be switched off (it's mostly not a block cursor). See t_vi

Made ":g/#/d" a lot faster by not calling cursupdate() for each deleted line. See :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. See :all :ball

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 file name 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, give a warning message if it has changed. See 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.

When there is an argument list and we are not really editing the 3th 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.

Added termcap options for "cd", clear until end of display. Works faster than repeating "ce", clear to end of line.

When changing the terminal name, restore the title and other things before clearing the terminal codes, 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). See :!

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. See '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.

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. See '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'. See 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. See vim_rlh.html

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.

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. See 'ruler'

When trying to quite Vim while there is a modified, hidden buffer, make that buffer the current buffer. Helps the user to decide to use "q!" or ":wq". See hidden_quit

VI COMPATIBILITY IMPROVEMENTS

Added "\?", "\/" and "\&" to ex address parsing, use previous search or substitute pattern. See :range

Set alternate file name for ":file fname" command.

When using "D" in an empty line, give beep.

Accept CTRL-Q in Insert mode and command line mode like CTRL-V.

Added "-R" command line option: readonly mode.

Added "-L" command line argument, same as "-r", do recovery.

Don't set 'readonly' for each file in readonlymode.

"Vim +/pat file" now finds pat in line 1.

Quit readonly mode when the 'readonly' option is reset in any buffer.

Made ":|" print current line (used to do nothing).

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}" command line option. It is ignored (Vi sets the 'window' option to {number}).

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".

Allow range for ":xit", ":exit" and ":wq".

Added ":open" command (not supported), to make ":o" not to be recognized as ":only".

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. See ''

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.

In replace mode NL does not replace a character but is inserted. Fixed 'r<CR>'. 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.

Allow ';' after search command, e.g. "/pat/;?foo".//;

Made <Home> 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. See :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". See :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>>".

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.

In a search_pattern '*' is not magic when used as the first character.

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.

When writing part of the buffer to the current file '!' is required. Could accidently destroy the file when giving a line range or when Visual was active when 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. See :w!

"r" now sets the last inserted text.

Allow "map a ab", head recursive_mapping (just like vi).

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 ".

Fixed CTRL-V's not being removed from argument to :map.

Made "|" exclusive.

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. See :filename

When command line causes an error, don't execute the next command after '|'.

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 don't do anything. This is vi compatible.

Added support for abbreviations that end in a non-keyword character.

When 'formatoptions' option is set to "vt", formatting is done vi-compatible. See format 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 ':'.

Fixed vi incompatibility: "o<Esc>u" didn't put the cursor back where it was before. "O<Esc>u" is still incompatible, this is considered a bug in Vi, because it puts the cursor in another line. See u

Made "zz" at end of file also put cursor in middle of window, making some "~" lines visible.

Fixed files being written when 'autowrite' is on and a filter command is used.

Screen updating for "J" improved a bit. Was clearing the cursor line instead of the next line. Looks smoother now.

For ":sleep" command: Position 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 any 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.

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 <CR> 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 is no inserted text yet didn't quit Insert mode.

Fixed bug where nowrap is 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 like '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 argument file-number to getfile() and doecmd() 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').

MSDOS: 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 <BS> on the command line.

Removed the screenclear() calls for MSDOS 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 command 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 canceled with ESC (e.g. using "p" after ""ad<ESC>" 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 tocursupdate() 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 line ":!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 "/<CR>".

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 a 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 to be 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 in 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-recursive. Fixed abbreviations being applied when inserting a register in Insert mode with CTRL-R.

Fixed -- INSERT -- message 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, 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 for 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 to try 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 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, 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 trunctated.

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 Alpha's 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 the short file name is used for reading/writing the file when ":cd" has not been used. On MS-DOS a "cd" in a sub-shell also changes the current directory for Vim, which causes the file to be written in a 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.

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 then 2M 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 updated 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".

Fixed operator with "}", when end is on last line in the file and it's empty. The last line was included instead of excluded.

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.


Send feedback on this page to Rajesh Kallingal
For Vim version 3.24. Last modification: 1996 Apr 25