Vim Documentation: version5


   For Vim version 5.0p.  Last modification: 1997 Sep 01


		  VIM REFERENCE MANUAL    by Bram Moolenaar

[TODO]

Welcome to Vim Version 5.0!

This document lists the differences between Vim 4.x and Vim 5.0.
Although 5.0 is mentioned here, this is also for version 5.1, 5.2, etc..
See |vi_diff.txt| for a short overview of differences between Vi and Vim 5.0.

INCOMPATIBLE:
Default value for 'compatible' changed	|cp-default|
Text formatting command "Q" changed	|Q-command-changed|
Autocommands are kept			|autocmds-kept|
X-Windows Resouces changed		|x-resources|

NEW FEATURES:
Syntax highlighting			|new-highlighting|
Built-in script language		|new-script|


Default value for 'compatible' changed
In version 4.* the default value for the 'compatible' option was off. Now that Vim version 5.0 tries to be more Vi compatible, the default is on. The first thing you will notice is that the "u" command undoes itself. Other side effects will be that mappings may not work in the same way, or not at all. Since a lot of people switching from Vim 4.x to 5.0 will be annoyed by this, the 'compatible' option is switched off if a vimrc file is found. This is a bit of magic, to make sure that 90% of the Vim users will not be bitten by this change. What does this mean? - If you prefer to run in 'compatible' mode, and don't have a vimrc file, you don't have to do anything. - If you prefer to run in 'nocompatible' mode, and do have a vimrc file, you don't have to do anything. - If you prefer to run in 'compatible' mode, and do have a vimrc file, you should put this line first in your vimrc file: > :set compatible - If you prefer to run in 'nocompatible' mode, and don't have a vimrc file, you can use one of these ways: - Create an empty vimrc file (e.g.: "~/.vimrc" for Unix). - Put this command in your .exrc file or $EXINIT: > :set nocompatible - Start Vim with the "-N" argument. If you are new to Vi and Vim, using 'nocompatible' is strongly recommended, because Vi has a lot of unexpected side effects, which are avoided by this setting. See 'compatible'. If you like some things from 'compatible' and some not, you can tune the compatibility with 'cpoptions'. Text formatting command "Q" changed
The "Q" command was formerly used to format lines to the width given with the 'textwidth' option. This is now "gq" (see |gq| for more info). The reason why this change had to be made was that "Q" is the standard vi command to enter "Ex" mode, and Vim now does in fact have an "Ex" mode (see |Q| for more info). If you still want to use "Q" for formatting, use this mapping: > :noremap Q gq Autocommands are kept
Before version 5.0, autocommands with the same event, file name pattern and command could appear only once. This was fine for simple autocommands, like setting option values. But for more complicated autocommands this restriction causes problems. Therefore, autocommands are stored and kept in the order that they are defined. The most obvious side effect of this change is that when you source a vimrc file twice, the autocommands in it will be defined twice. To avoid this, do one of these: - Remove any autocommands that might potentially defined twice, before defining them. Example: > :au! .ext > :au BufEnter *.ext ... - Put the autocommands inside an ":if" command. Example: > if !exists("did_ext_autocmds") > let did_ext_autocmds = 1 > autocmd BufEnter *.ext ... > endif - Put your autocommands in a different autocommand group, to be able to remove them before defining them |:augroup|: > augroup uncompress > au! > au BufReadPost *.gz ... > augroup END X-Windows Resouces changed
TODO (something about which resources have changed or disappeared, e.g. font coloring, cursor coloring). Syntax highlighting
Built-in script language
vim:ts=8:sw=8:tw=78:

Generated by vim2html on Mon Nov 3 03:34:24 EST 1997