*version6.txt*  For Vim version 6.0m.  Last change: 2000 Nov 12


		  VIM REFERENCE MANUAL    by Bram Moolenaar


Welcome to Vim Version 6.0!

	Vim 2001, a folding space odyssey
	Where do you want to fold today?


This document lists the differences between Vim 5.x and Vim 6.0.
See |vi_diff.txt| for an overview of differences between Vi and Vim 5.0.
See |version4.txt| for differences between Vim 3.0 and Vim 4.0.
See |version5.txt| for differences between Vim 4.0 and Vim 5.0.

INCOMPATIBLE CHANGES			|incompatible-6|
Cursor position in Visual mode		|curpos-visual|
substitute command			|substitute-CR|
'include' option local			|include-local|
global option values used		|new-global-values|
'fileencoding' obsolete			|fileencoding-obsolete|
Digraphs changed			|digraphs-changed|
Filetype detection changed		|filetypedetect-changed|
CTRL-U in Command-line mode		|CTRL-U-changed|
Ctags gone				|ctags-gone|
Documentation				|documentation-6|
Small incompatibilities			|incomp-small-6|

NEW FEATURES
Folding					|new-folding|
Vertically split windows		|new-vertsplit|
Extended search patterns		|new-searchpat|
Flexible indenting			|new-indent-flex|
UTF-8 support				|new-utf-8|
Multi-language support			|new-multi-lang|
Plugin support				|new-plugins|
Filetype plugins			|new-filetype-plugins|
Cursor in virtual position		|new-virtedit|
Debugger interface			|new-debug-itf|
Buffer types				|new-buftype|
Ports					|ports-6|
Quickfix extended			|quickfix-6|
Operator modifiers			|new-operator-mod|
Search Path				|new-search-path|
Editing files over a network		|new-network-files|
Writing files				|new-file-writing|
Various new items			|new-items-6|

IMPROVEMENTS				|improvements-6|

COMPILE TIME CHANGES			|compile-changes-6|

BUG FIXES				|bug-fixes-6|

==============================================================================
INCOMPATIBLE CHANGES				*incompatible-6*

These changes are incompatible with previous releases.  Check this list if you
run into a problem when upgrading from Vim 5.x to 6.0


Cursor position in Visual mode			*curpos-visual*
------------------------------

When going from one window to another window on the same buffer while in
Visual mode, the cursor position of the other window is adjusted to keep the
same Visual area.  This can be used to set the start of the Visual area in one
window and the end in another.


substitute command				*substitute-CR*
------------------

The substitute string has been made Vi compatible.  Previously a CTRL-V had a
special meaning and could be used to prevent a <CR> to insert a line break.
This made it impossible to insert a CTRL-V at the end of a line.  Now a
backslash is used to prevent a <CR> to cause a line break.  Since the number
of backslashes is halved, it is still possible to insert a line break at the
end of the line.  This now works just like Vi, but it's not compatible with
Vim versions before 6.0.

When a ":s" command doesn't make any substitutions, it doesn't set the '[ and
'] marks.


'include' option local				*include-local*
----------------------

The 'include' option is now local to the buffer.  Each language may require
another 'include' option value.  This only matters if you set the 'include'
option and expect it to have the new value in other buffers too.


Global option values used			*new-global-values*
-------------------------

There are now global values for options which are local to a buffer or window.
Previously the local options were copied from one buffer to another.  When
editing another file this could cause options set in a modeline to be used for
the wrong file.  Now the global values are used when entering a buffer that
has not been used before.  Also, when editing another buffer in a window, the
local window options are reset to their global values.  The ":set" command
sets both the local and global values, this is still compatible.  But a
modeline only sets the local value, this is not backwards compatible.


'fileencoding' obsolete				*fileencoding-obsolete*
-----------------------

'fileencoding' is no longer to be used.  It is now equivalent to the new
'charcode' option, which is global.  'fileencoding' was local to a buffer, but
it could never be different between buffers, because it changed the way text
in all buffers was interpreted.  The FileEncoding autocommand now does the
same as the new CharCode event.


Digraphs changed				*digraphs-changed*
----------------

The default digraphs now correspond to RFC1345.  This is different from
what was used in Vim 5.x. |digraphs|


Filetype detection changed			*filetypedetect-changed*
--------------------------

The filetype detection previously was using the "filetype" autocommand group.
This caused confusion with the FileType event name.  The group is now called
"filetypedetect".  It still works, but if the "filetype" group is used the
autocommands will not be removed by ":filetype off".
The support for 'runtimepath' has made the "myfiletypefile" and "mysyntaxfile"
mechanism obsolete.  They are still used for backwards compatibility.
The connection between the FileType event and setting the 'syntax' option was
previously in the "syntax" autocommand group.  That caused confusion with the
Syntax event name.  The group is now called "syntaxset".


CTRL-U in Command-line mode			*CTRL-U-changed*
---------------------------

CTRL-U in the command line cleared the whole line.  Most shells only delete
the characters before the cursor.  Made it like that. (Steve Wall)
You can get the old behavior with CTRL-E CTRL-U: >
	:cnoremap <C-U> <C-E><C-U>

Ctags gone					*ctags-gone*
----------

Ctags is no longer part of the Vim distribution.  It's now a grown-up program
by itself, it deserves to be distributed separately.  However, the binary
archives do include the ctags program, since it's small and useful.
Ctags can be found here: http://darren.hiebert.com/ctags/index.html.


Documentation					*documentation-6*
-------------

The documentation has been reorganized, an item may not be where you found it
in Vim 5.x.
- Split into a reference manual and a user manual.
- Put the quick reference in a separate file (so that it can be printed).

The examples in the documentation were previously marked with a ">" in the
first column.  This made it difficult to copy/paste them.  There is now a
single ">" before the example and it ends at a "<" or a non-blank in the first
column.  This also looks better without highlighting.

When syntax highlighting is not enabled, the characters in the help file which
mark examples ('>' and '<') and header lines ('~') are replaced with a space.

The help window now always appears at the top of the Vim window.  Previously
it appeared above the current window.

'helpfile' is no longer used to find the help tags file.  This allows a user
to add its own help files (e.g., for plugins).

When doing ":help tag", don't open help.txt first, jump directly to the help
tag.  It's faster and avoids an extra message.


Small incompatibilities				*incomp-small-6*
-----------------------

Removed '_' from the 'breakat' default: It's commonly used in keywords.

The default for 'mousehide' is on, because this works well form most people.

The Amiga binary is now always compiled with 'big" features.  The "big" binary
archive no longer exists.

The items "[RO]", "[+]", "[help]", "[Preview]" and "[filetype]" in
'statusline' no longer have a leading space.

Non-Unix systems: When expanding wildcards for the Vim arguments, don't use
'suffixes'.  It now works as if the shell had expanded the arguments.

The 'lisp', 'smartindent' and 'cindent' options are not switched off when
'paste' is set.  The auto-indenting is disabled when 'paste' is set, but
manual indenting with "=" still works.

When formatting with "=" uses 'cindent' or 'indentexpr' indenting, and there
is no change in indent, this is not counted as a change ('modified' isn't set
and there is nothing to undo).

The "Save As" menu entry now edits the saved file.  Most people expect it to
work like this.

Renamed <Return> to <Enter>, since that's what it's called on most keyboards.
Thus it's now the hit-enter prompt instead of the hit-return prompt.

The help items for syntax files are now tagged with "-syntax" instead of
".vim", because the indent and filetype plugins use "-indent" and "-plugin".

The default for the 'viminfo' option is now '50,"50,h when 'compatible' isn't
set.  Most people will want to use it, including beginners, but it required
setting the option, which isn't that easy.

After using ":colder" the newer error lists are overwritten.  This makes it
possible to use ":grep" to browse in a tree-like way.  Must use ":cnewer 99"
to get the old behavior.

==============================================================================
NEW FEATURES

Folding							*new-folding*
-------

Vim can now display a buffer with text folded.  This allows overviewing the
structure of a file quickly.  It is also possible to move folded text, for
example to move a function to another position.
See |folding|.


Vertically split windows				*new-vertsplit*
------------------------

Windows can also be split vertically.  This makes it possible to have windows
side by side.  One nice use for this is to compare two similar files.  The
'scrollbind' option can be used to synchronize scrolling.

A vertical split can be created with the commands:
	:vsplit	  or  CTRL-W v  or CTRL-W CTRL-V	|:vsplit|
	:vnew						|:vnew|
	:vertical {cmd}					|:vertical|
The last one is a modifier, which has a meaning for any command that splits a
window.  For example: >
	:vertical stag main
Will vertically split the window and jump to the tag "main" in the new window.

Moving from window to window horizontally can be done with the |CTRL-W_h| and
|CTRL-W_l| commands.  The |CTRL-W_k| and |CTRL-W_j| commands have been changed
to jump to the window above or below the cursor position.

The vertical and horizontal splits can be mixed as you like.  Resizing windows
is easy when using the mouse, just position the pointer on a status line or
vertical separator and drag it.  In the GUI a special mouse pointer shape
indicates where you can drag a status or separator line.

To resize vertically split windows use the |CTRL-W_<| and |CTRL-W_>| commands.  To make a window the maximum width use the CTRL-W | command |CTRL-W_bar|.

To force a new window to use the full width or height of the Vim window,
these two modifiers are available:
	:topleft {cmd}		New window appears at the top with full
				width or at the left with full height.
	:botright {cmd}		New window appears at the bottom with full
				width or at the right with full height.
This can be combined with ":vertical" to force a vertical split: >
	:vert bot dsplit DEBUG
This will open a window at the far right, occupying the full height of the Vim
window, with the cursor on the first definition of "DEBUG".
The help window is always opened at the top, like ":topleft" was used.

A few options can be used to set the preferences for vertically split windows.
They work similar to their existing horizontal equavalents:
	horizontal	vertical ~
	'splitbelow'	'splitright'
	'winheight'	'winwidth'
	'winminheight'	'winminwidth'
It's possible to set 'winminwidth' to zero, so that temporarliy unused windows
hardly take up space without closing them.

The new 'eadirection' option tells where 'equalalways' applies:
	:set eadirection=both		both directions
	:set eadirection=ver		equalize window heights
	:set eadirection=hor		equalize windows widths
This can be used to avoid changing window sizes when you want to keep them.

Since windows can become quite narrow with vertical splits, text lines will
often not fit.  The 'sidescrolloff' has been added to keep some context left
and right of the cursor.  The 'listchars' option has been extended with the
"precedes" item, to show a "<" for example, when there is text left off the
screen. (Utz-Uwe Haus)


Flexible indenting					*new-indent-flex*
------------------

Automatic indenting is now possible for any language.  It works with a Vim
script, which makes it very flexible to compute the indent.

The 'indentexpr' option is evaluated to get the indent for a line.  The
'indentkeys' option tells when to trigger re-indenting.  Normally these
options are set from an indent script.  Like Syntax files, indent scripts will
be created and maintained by many people.


Extended search patterns				*new-searchpat*
------------------------

Multi-line patterns: (Loic Grenie)
\n		match end-of-line, also in []
\_[]		match characters in range and end-of-line
\_x		match character class and end-of-line
\_.		match any character or end-of-line

\c		ignore case for the whole pattern
\C		match case for the whole pattern
\m		magic on for the following
\M		magic off for the following

\@!		don't match atom before it.
		Example: "foo\(bar\)\@!" matches "foo " but not "foobar".
\@=		match atom, resulting in  zero-width match
		Example: "foo\(bar\)\@=" matches "foo" in "foobar".
\@<!		don't match atom before it before the current position
\@<=		match atom before it before current position
\@>		match preceding atom as a subexpression

\&		match only when branch before and after it match

For syntax items:
\z(...\)	external reference match set (in region start pattern)
\z1 - \z9	external reference match use (in region skip or end pattern)
	(Scott Bigham)

\zs		use position as start of match
\ze		use position as end of match

Removed limit of matching only up to 32767 times with *, \+, etc.

Added some support for double-byte characters. (Muraoka)


UTF-8 support						*new-utf-8*
-------------

Vim can now edit files in UTF-8 encoding.  Up to 31 bit characters can be
used, but only 16 bit characters are displayed.  Up to two combining
characters are supported, they overprint the preceding character.
Double-width characters are also supported.  See |UTF-8|.

UCS-2 and UCS-4 encodings are supported too, they are converted to UTF-8
internally.  Other encodings are converted with iconv() or an external
converter specified with 'charconvert'.

Many new items for Multi-byte support:
- Added 'charcode' option: specifies character coding used inside Vim.
- Added 'filecharcode' and 'filecharcodes': specify character coding in a
  file, similar to 'fileformat' and 'fileformats'.
  When 'charcode' is "utf-8" and 'filecharcodes' is "utf-8,latin-1" this will
  automatically switch to latin-1 if a file does not contain valid UTF-8.
- Added 'guifontwide' for double-width font.
- Added Korean support for character class detection.  Also fix cls() in
  search.c. (Chong-Dae Park)

Allow defining digraphs for multi-byte characters.
Added RFC1345 digraphs for Unicode.
Most Normal mode commands that accept a character argument, like "r", "t" and
"f" now accept a digraph.  The 'D' flag in 'cpoptions' disables this to remain
Vi compatible.


Multi-language support					*new-multi-lang*
----------------------

- Added +multi_lang feature.
- Prepared for use of gettext() by putting translatable strings in _().
  Added "po" directory with German and Polish translations.
  (Marcin Dalecki)
- Added v:lang variable to be able to get current language setting.
  (Marcin Dalecki)
- Added ":language" command to set the language (locale)
- Added ":menutrans" to be able to translate menu paths.
- Added German and Polish menu translations (Marcin Dalecki)
- removed "broken locale" (Marcin Dalecki0.
- don't user color names in icons, use RGB values.
- Win32: Added global IME support (Muraoka)


Plugin support					*new-plugins*
--------------

To make it really easy to load a Vim script when starting Vim, the "plugin"
runtime directory can be used.  All "*.vim" files in it will be automatically
loaded.  For Unix, the directory "~/.vim/plugin" is used by default.  The
'runtimepath' option can be set to look in other directories for plugins.
|load-plugins| |add-plugin|

The |:runtime| command has been added to load one or more files in
'runtimepath'.

Standard plugins:
netrw.vim - Edit files over a network
gzip.vim - Edit compressed files
explorer.vim - Browse directories

Added support for local help files. |add-local-help|.
When searching for help tags, all "doc/tags" files in 'runtimepath' are used.
Added the ":helptags" command: Generate a tags file for a help directory.
The first line of each help file is automagically added to the "LOCAL
ADDITIONS" section in doc/help.txt.

<unique> argument to ":map": only add a mapping when it wasn't defined before.


Filetype plugins				*new-filetype-plugins*
-----------------

A new group of files has been added to do settings for specific file types.
These can be options and mappings which are specifically used for one value of
'filetype'.

The files are located in "$VIMRUNTIME/ftplugin".  The 'runtimepath' option
makes it possible to use several sets of plugins: Your own, system-wide,
included in the Vim distribution, etc.

To be able to make this work, several features were added:
- Added the "s:" variables, local to a script.  Avoids name conflicts with
  global variables.  They can be used in the script and in functions,
  autocommands and user commands defined in the script. |s:var|
  automatically deletes them when the script ends.
- Added the global value for local options.  This value is used when opening
  a new buffer or editing another file.  The option value specified in a
  modeline or filetype setting is not carried over to another buffer.
  ":set" sets both the local and the global value.
  ":setlocal" sets the local option value only.
  ":setglobal" displays the global value for a local option.  Setting only
  the global value isn't implemented yet.
- Added mappings and abbreviations local to a buffer: ":map <buffer>".
- In a mapping "<Leader>" can be used to get the value of the "mapleader"
  variable.  This simplifies mappings that use "mapleader".  "<Leader>"
  defaults to "\".  "<LocalLeader>" does the same with "maplocalleader".  This
  is to be used for mappings local to a buffer.
- Added <SID> Script ID to define functions and mappings local to a script.
- Added <script> argument to ":noremap" and ":noremenu": Only remap
  script-local mappings.  Avoids that mappings from other scripts get in the
  way, but does allow using mappings defined in the script.
- User commands can be local to a buffer: ":command -buffer".

The new ":setfiletype" command is used in the filetype detection autocommands,
to avoid that 'filetype' is set twice.


Cursor in virtual position				*new-virtedit*
--------------------------

'virtualedit' option: Allow positioning the cursor where there is no actual
character in Insert mode, Visual mode or allways. (Matthias Kramm)
This is especially useful in Visual-block mode.  It allows positioning a
corner of the area where there is no text character.


Debugger interface					*new-debug-itf*
------------------

This was originally made to work with Sun Visual Workshop. (Gordon Prieur)
- ":glyph", ":unglyph", ":glyphdef" and ":glyphs" commands: Add a small image
  in front of a line.
- ":sense" set menu sensitive on/off
- ":wsverb"
- Documentation: |debugger.txt|, |sign.txt|, |workshop.txt|
- Balloon stuff: 'balloondelay' and 'ballooneval' options.


Buffer types						*new-buftype*
------------

'buftype' option: special buffer type.
"quickfix": Shows the error list, allowing to jump to the error location.
"nofile": A buffer that's not associated with any file.
"scratch": A buffer that's not associated with any file and gets deleted as
soon as there is no window left that displays its contents


Ports							*ports-6*
-----

Port to OS/390 Unix (Ralf Schandl)
- A lot of changes to handle EBCDIC encoding.
- Changed Ctrl('x') to Ctrl_x define.

Included jsbmouse support. (Darren Garth)
Support for dec mouse in Unix. (Steve Wall)

Port to 16-bit MS Windows (Windows 3.1x) (Vince Negri)

Allow cross-compiling the Win32 version with Make_ming.mak. (Ron Aaron)
Added Python support for compiling with Mingw. (Ron Aaron)

Win32: Dynamically load Perl and Python.  Allows compiling Vim with these
interfaces and will try to find the DLLs at runtime. (Muraoka Taro)


Quickfix extended					*quickfix-6*
-----------------

- ":cwindow": open window to show list of quickfix errors.  Can be used to
  scroll through the errors, and quickly jump to each of them.
- Quickfix also knows "info", next to "warning" and "error" types. "%I" can be
  used for the start of a multi-line informational message. (Tony Leneis)
- The "%p" argument can be used in 'errorformat' to get the column number from
  a line where "^" points to the column. (Stefan Roemer)


Operator modifiers					*new-operator-mod*
------------------

Insert "v", "V" or CTRL-V between an operator and a motion command to force
the operator to work characterwise, linewise or blockwise. |o_v|


Search Path						*new-search-path*
-----------

- Support upward search for 'path', 'cdpath' and 'tags' options.  Also use
  "**" for 'tags' option. (Ralf Schandl)
- Added 'includeexpr', can be used to modify file name found by 'include'
  option.
- 'cdpath' option: Locations to find a ":cd" argument. (Raf)
- Added 'suffixesadd', suffixes to be added to a file name when searching for
  a file for the "gf", "[I", etc. commands.


Editing files over a network				*new-network-files*
----------------------------

Files starting with scp://, rcp://, ftp:// and http:// are recognized as
remote files.  An attempt is made to access these files with the indicated
method.  For http:// only reading is possible, for the others writing is also
supported.  Uses the netrw.vim script as a standard "plugin". |netrw|

Made "gf" work on a URL.  It no longer assumes the file is local on the
computer (mostly didn't work anyway, because the full path was required).
Adjusted test2 for this.

Allow using a URL in 'path'.  Makes ":find index.html" work.


Writing files						*new-file-writing*
-------------

Added the 'backupcopy' option: Select whether a file is copied or renamed to
make a backup file.  Useful on Unix to speed up writing an ordinary file.
Useful on other systems to preserve file attributes and when editing a file on
a Unix filesystem.

Added the 'autowriteall' option.  Works like 'autowrite' but for more
commands.

Added the 'backupskip' option: A pattern to skip making a backup file when it
matches.  The default is "^/tmp", this makes "crontab -e" work.

Added support for Access Control Lists (ACL) for FreeBSD and Win32.  The ACL
is copied from the original file to the new file (or the backup if it's
copied).


Various new items					*new-items-6*
-----------------

Interface to Ruby. (Shugo Maeda)

:silent[!] cmd
		Execute a command silently.
		RISCOS: Removed that "!~cmd" didn't output anything, and
		didn't wait for <Enter> afterwards.  Can use ":silent !cmd"
		now.

:finish		Finish sourcing a file.  Can be used to skip the rest of a Vim
		script. |:finish|

:first, :bfirst, :ptfirst, etc.
		Alias for ":rewind".  It's more logical compared to ":last".

:enew		Edit a new, unnamed buffer.  This is needed, because ":edit"
		re-edits the same file. (Wall)

:quitall	Same as ":qall".

:menu enable
:menu disable	Commands to enable/disable menu entries without removing them.
		(Monish Shah)

:lcd and :lchdir
		Set local directory for a window. (Benjie Chen)

:hide {command}
		Execute {command} with 'hidden' set.

:emenu		in Visual mode to execute a ":vmenu" entry.

:popup		pop up a popup menu.

[', [`, ]' and ]`
		move the cursor to the next/previous lowercase mark.

g_		Go to last non-blank in line. (Steve Wall)

New marks:
'( and '): begin or end of current sentence.  Useful in Ex commands.
'{ and '}: begin or end of current paragraph.  Useful in Ex commands.

New functions:
foldclosed()	Find out if there is a closed fold. (Johannes Zellner).
foldlevel()	Find out the foldlevel. (Johannes Zellner)
getbufvar()	gets the value of an option or local variable in a buffer (Ron
		Aaron)
getfsize()	Return the size of a file.
getwinvar()	gets the value of an option or local variable in a window (Ron
		Aaron)
hasmapto()	Detect if a mapping to a string is already present.
indent()	gets the indent of a line (Ron Aaron)
libcall()	for Unix (Neil Bird, Johannes Zellner, Stephen Wall)
libcallnr()	for Win32 and Unix
mode()		Return a string that indicates the current mode.
nextnonblank()	Skip blank lines forwards.
prevnonblank()	Skip blank lines backwards.  Useful to for indent scripts.
search()	Search for a pattern.
setbufvar()	sets an option or variable local to a buffer (Ron Aaron)
setwinvar()	sets an option or variable local to a window (Ron Aaron)
stridx()	Search for first occurrence of one string in another.
strridx()	Search for last occurrence of one string in another.
tolower()	Convert string to all-lower case.
toupper()	Convert string to all-upper case.
type()		Check the type of an expression.
winwidth()	Width of a window. (Johannes Zellner)

The ":command" command now accepts a "-bar" argument.  This allows the user
command to be followed by "| command".

The preview window is now also used by these commands:
|:pedit| edits the specified file in the preview window
|:psearch| searches for a word in included files, like |:ijump|, and
displays the found text in the preview window.

MS-DOS and MS-Windows also read the system-wide vimrc file $VIM/vimrc.  Mostly
for NT systems with multiple users.

A double-click of the mouse on a character that has a "%" match selects from
that character to the match.  Similar to "v%".

==============================================================================
IMPROVEMENTS						*improvements-6*

'n' flag for 'cpoptions': When omitted text of wrapped lines in not put
between line numbers from 'number' option.

When there is a format error in a tags file, the byte position is reported so
that the error can be located.

Allow a tags file to have CR, CR-LF or LF line separator.  Useful on the
Macintosh.

The DOS/Windows install program has been enhanced.  The Vim executable is
never moved or $PATH changed.  A small batch file is created in a directory in
$PATH.  Less choices to be made.

The window title now has "VIM" on the end.  The file name comes first, useful
in the taskbar.  A "+" is added when the file is modified.  "=" is added for
a read-only file.

Added "b:changedtick" variable.  Incremented at each change, also for undo.
Can be used to take action only if the buffer has been changed.

In the replacement string of a ":s" command "\=" can be used to replace with
an expression.  The submatch() function can be used to access submatches.

When dragging the status line or the vertical separator, mouse codes are
skipped to avoid that the redrawing lags behind too much.

Insert mode:
"CTRL-G j" and "CTRL-G k" can be used to insert in another line in the same
column.  Useful for editing a table.
Thesaurus completion with CTRL-X CTRL-T. (Vince Negri)
Added the 'thesaurus' option, to use instead of 'dictionary' for thesaurus
completion.  Added 's' flag in 'complete'.

Performance:
- Made display updating more efficient.  Insert/delete lines may be used for
  all changes, also for undo/redo.
- Display is not redrawn when there is typeahead in Insert mode.  Speeds up
  CTRL-R a lot.
- Improved speed of screen output for 32 bit DOS version. (Vince Negri)
- When dragging with the mouse, there is a lookahead to skip mouse codes when
  there is another one next.  Makes dragging with the mouse a lot faster.
- Also a memory usage improvement: When calling u_save with a single line,
  don't save it if the line was recently saved for the same undo already.
- When using a script that appends one character at a time, the amount of
  allocated memory was growing steadily.  Also when 'undolevels' is -1.
  Caused by the line saved for "U" never to be freed.  Now free an undo block
  when it becomes empty.

Robustness:
- Unix: Check for running out of stack space when executing a regexp.  Avoids
  a nasty crash.  Only works when the system supports running the signal
  function on another stack.
- Unix: Added check for running out of stack space when matching a regexp.
  Now it aborts with an error message.  Needs to be checked on many different
  systems.

Security:
- When reading from or writing to a temporary file, check that it isn't a
  symbolic link.  Gives some protection against symlink attacks.
- When creating a backup file copy or a swap file, check for it already
  existing to avoid a symlink attack. (Colin Phipps)

Reduced the amount of stack space used by regmatch() to allow it to handle
complicated patterns on a longer text.

Syntax highlighting:
- Optimized by caching the state stack all over the file, not just the part
  being displayed.  Required for folding.
- Added ":syn sync fromstart": Always parse from the start of the file.
- Added "display" argument: use this item only when displaying the result.
  Can make parsing faster for text that isn't going to be displayed.
- When using CTRL-L, the cached states are deleted, to force parsing the text
  again.
- Use elfhash algorithm for table of keywords.  This should give a better
  distribution and speedup keyword lookup. (Campbell)
- Also allow the "lc" leading context for skip and end patterns. (Scott
  Bigham)

Win32 console version:
- Includes the user and system name in the ":version" message, when available.
  It generates a pathdef.c file for this.  (Jon Miner)
- Set the window icon to Vim's icon (only for Windows 2000).  While executing
  a shell command, modify the window title to show this.  When exiting,
  restore the cursor position too.  (Craig Barkhouse)

Win32: When $HOMEDRIVE and $HOMEPATH are defined, use them to define $HOME.
(Craig Barkhouse)

Added keypad special keys <kEnter>, <k0> - <k9>.  When not mapped they behave
like the ASCII equivalent. (Ivan Wellesz and Vince Negri)

Autocommands:
FileReadCmd, BufReadCmd, FileWriteCmd, BufWriteCmd, FileAppendCmd: use
autocommands instead of normal file read/write.  Use this in netrw.vim to be
able to edit files on a remote system. (Charles Campbell)
FuncUndefined: When a user function is not defined. (Ron Aaron)

TermReponse autocommand event and v:termreponse internal variable.  Can be
used to react to the version of the terminal.  (Ronald Schild)

GUI:
- X11: When a color can't be allocated, use the nearest match from the
  colormap.  This avoids that black is used for many things. (Monish Shah)
  Also do this for the menu and scrollbar, to avoid that they become black.
- Win32 and X11: Added 'mouseshape' option: Adjust the mouse pointer shape to
  the current mode. (Vince Negri)
- 'linespace' option: Insert a pixel line between lines. (Nam)
- Allow non-Visual selection (without moving the cursor) by keeping CTRL and
  SHIFT pressed. (Ivan Wellesz)
- Motif: added toolbar. (Gordon Prieur)
- Win32: Added "c" flag to 'guifont' to be able to specify the charset. (Artem
  Khodush)

GTK GUI: (partly by Marcin Dalecki)
-   With some fonts the characters can be taller than ascent + descent.  E.g.,
    "-misc-fixed-*-*-*-*-18-*-*-*-*-*-iso10646-1".  Add one to the character
    cell height?
-   Implement "no" value for 'winaltkeys': don't use Alt-Key as a menu
    shortcut, when 'wak' changed after creating the menus.
- recycle text GC's to reduce communication.
- Adjust icon size to window manager.
- Cleanup in font handling.
- Setting 'wak' after the GUI started works.
- replace XQueryColor with GDK calls.
- Gnome support.  Detects Gnome in configure and uses different widgets.
  Otherwise it's much like GTK. (Kahn)
- Removed the special code to fork first and then start the GUI.  Now use
  _exit() instead of exit() and works fine without other tricks.
- Dialogs sometimes appeared a bit far away.  Position the dialogs inside
  the gvim window. (Brent Verner)

Command line completion:
Complete environment variable names. (Mike Steed)
For ":command", added a few completion methods: "mapping", "function",
"expression" and "environment".

Added "improved Ex mode".  Entered when Vim is started as "exim" or "vim -E",
and with the "gQ" command.  Works like repeated use of ":", with full
command-line editing and completion. (Ulf Carlsson)

Redirect messages to the clipboard ":redir @*" and to the unnamed register
":redir @"". (Wall)

":let @/ = ''" clears the search pattern, instead of setting it to an empty
string.

In a ":highlight" listing, show "xxx" with the highlight color.

Expression evaluation:
"? :" can be used like in C.
col("$") returns the length of the cursor line. (Stephen P. Wall)

Optional extra argument for match(), matchend() and matchstr(): Offset to
start looking for a match.
Made third argument to strpart() optional.  (Paul Moore, Zdenek Sekera)

Cscope: (kahn)
cscope_connection() function.
":cscope kill -1" kills all cscope connections.

exists() can also be used to check for Ex commands.

VMS: Command line arguments are always uppercase.  Interpret a "-X" argument
as "-x" and "-/X" as "-X".

Options:
- When using set += or ^= , check for strings used twice.  Duplicates are
  removed.  (Vince Negri)
- When setting an option that is a list of flags, remove duplicate flags.
- 'autoread' option: When detected that a file changed outside of Vim,
  automatically read a buffer again when it's not changed.
- If possible, use getrlimit() to set 'maxmemtot' and 'maxmem'. (Pina)
- Added "alpha" to 'nrformats': increment or decrement an alphabetic character
  with CTRL-A and CTRL-X.
- ":set opt&vi" sets an option to its Vi default, ":set opt&vim" to its Vim
  default.  Useful to set 'cpo' to its Vim default without knowing what flags
  that includes.
- 'scrolloff' now also applies to a long, wrapped line that doesn't fit in the
  window.

Internal changes:
- Split line pointers in text part and attributes part.  Allows for future
  change to make attribute more than one byte.
- Provide a qsort() function for systems that don't have it.
- Changed the big switch for Normal mode commands into a table.  This cleans
  up the code considerably and avoids trouble for some optimizing compilers.
- Support for editing Unicode and UTF-8 files.
- Assigned a negative value to special keys, to avoid them being mixed up with
  Unicode characters.
- Global variables expand_context and expand_pattern were not supposed to be
  global.  Pass them to ExpandOne() and all functions called by it.

Support for xterm with 88 or 256 colors.  The right color numbers will be used
for the name used in a ":highlight" command. (Steve Wall)

When an xterm is in 8-bit mode this is detected by the code returned for
|t_RV|.  All key codes are automatically converted to their 8-bit versions.

The OPT_TCAP_QUERY in xterm patch level 141 and later is used to obtain the
actual key codes used and the number of colors for t_Co.  Only when |t_RV| is
also used.

":browse set" now also works in the console mode.  ":browse edit" will give an
error message.

":bdelete" and ":bunload" only report the number of deleted/unloaded buffers
when more than 'report'.  The message was annoying when deleting a buffer in a
script.

The number of marks kept in the jumplist has been increased from 50 to 100.

Python interface: Allow setting the width of a vertically split window. (John
Cook)

Added "=word" and "=~word" to 'cinkeys' (also used in 'indentkeys').

When doing Insert mode completion, when completion is finished check for a
match with words from 'cinkeys' or 'indentkeys'.

When doing ":wall" or ":wqall" and a modified buffer doesn't have a name,
mention its buffer number in the error message.

":function Name" lists the function with line numbers.  Makes it easier to
find out where an error happened.

In non-blockwise Visual mode, "r" replaces all selected characters with the
typed one, like in blockwise Visual mode.

"default" argument for ":highlight".  When included, the command is ignored if
highlighting for the group was already defined.
All syntax files now use ":hi default ..." to allow the user to specify colors
in his vimrc file.  Also, the "if did_xxx_syntax_inits" is not needed anymore.
This greatly simplifies using non-default colors for a specific language.

Also set "v:errmsg" when using ":silent! cmd".

==============================================================================
COMPILE TIME CHANGES					*compile-changes-6*

All generated files have been moved out of the "src" directory.  This makes it
easy to see which files are not edited by hand.  The files generated by
configure are now in the "src/auto" directory.  For Unix, compiled object
files go in the objects directory.

Included features are now grouped in "tiny", "small", "normal", "big" and
"huge".  This replaces "min-features" and "max-features".  Using "tiny"
disables multiple window for a really small Vim.

Removed GTK+ support for versions older than 1.1.16.

The configure checks for using PTYs have been improved.  Code taken from a
recent version of screen.

Added configure options to install Vim, Ex and View under another name (e.g.,
vim6, ex6 and view6).

Made enabling the SNiFF+ interface possible with a Configure argument.

Configure now always checks /usr/local/lib for libraries and
/usr/local/include for include files.  Helps finding the stuff for iconv() and
gettext().

==============================================================================
BUG FIXES						*bug-fixes-6*

When checking the command name for "gvim", "ex", etc. ignore case.  Required
for systems where case is ignored in command names.

Search pattern "[a-c-e]" also matched a 'd' and didn't match a '-'.

When double-clicking in another window, wasn't recognized as double click,
because topline is different.  Added set_mouse_topline().

The BROKEN_LOCALE check was broken.  (Marcin Dalecki)

When "t_Co" is set, the default colors remain the same, thus wrong.  Reset the
colors after changing "t_Co". (Steve Wall)

When exiting with ":wqall" the messages about writing files could overwrite
eachother and be lost forever.

When starting Vim with an extremely long file name (around 1024 characters) it
would crash.  Added a few checks to avoid buffer overflows.

CTRL-E could get stuck in a file with very long lines.

":au syntax<Tab>" expanded event names while it should expand groups starting
with "syntax".

When expanding a file name caused an error (e.g., for <amatch>) it was
produced even when inside an "if 0".

'cindent' formatted C comments differently from what the 'comments' option
specified. (Steve Wall)

Default for 'grepprg' didn't include the file name when only grepping in one
file.  Now /dev/null has been added for Unix.

Opening the option window twice caused trouble.  Now the cursor goes to the
existing option window.

":sview" and ":view" didn't set 'readonly' for an existing buffer.  Now do set
'readonly', unless the buffer is also edited in another window.

GTK GUI: When 'guioptions' excluded 'g', the more prompt caused the toolbar
and menubar to disappear and resize the window (which clears the text).
Now always grey-out the toplevel menus to avoid that the menubar changes size
or disappears.

When re-using the current buffer for a new buffer, buffer-local variables were
not deleted.

GUI: when 'scrolloff' is 0 dragging the mouse above the window didn't cause a
down scroll.  Now pass on a mouse event with mouse_row set to -1.

Win32: Console version didn't work on telnet, because of switching between two
console screens.  Now use one console screen and save/restore the contents
when needed.  (Craig Barkhouse)

When reading a file the magic number for encryption was included in the file
length. (Antonio Colombo)

The quickfix window contained leading whitespace and NULs for multi-line
messages. (David Harrison)

When using cscope, redundant tags were removed.  This caused a numbering
problem, because they were all listed.  Don't remove redundant cscope tags.
(David Bustos).

Cscope: Test for which matches are in the current buffer sometimes failed,
causing a jump to another match than selected. (David Bustos)

Win32: Buffer overflow when adding a charset name in a font.

'titlestring' and 'iconstring' were evaluating an expression in the current
context, which could be a user function, which is a problem for local
variables vs global variables.

Win32 GUI: Mapping <M-F> didn't work.  Now handle SHIFT and CTRL in
_OnSysChar().

Win32 GUI: (on no file), :vs<CR>:q<CR> left a trail of pixels down the middle.
Could also happen for the ruler.  screen_puts() didn't clear the right char in
ScreenLines[] for the bold trick.

Win32: ":%!sort|uniq" didn't work, because the input file name touches the
"|".  Insert a space before the "|".

OS/2: Expanding wildcards included non-existing files.  Caused ":runtime" to
fail, which caused syntax highlighting to fail.

Mac: Also accept tags files in DOS format. (Axel Kielhorn)

Pasting a register containing CTRL-R on the command line could cause an
endless loop that can't be interrupted.  Now it can be stopped with CTRL-C.

When 'verbose' is set, a message for file read/write could overwrite the
previous message.
When 'verbose' is set, the header from ":select" was put after the last
message.  Now start a new line.

The hit-enter prompt reacted to the response of the t_RV string, causing
messages at startup to disappear.

When t_Co was set to 1, colors were still used.  Now only use color when t_Co
> 1.

Listing functions with ":function" didn't quit when 'q' or ':' was typed at
the more prompt.

Use mkstemp() instead of mktemp() when it's available, avoids a warning for
linking on FreeBSD.

When doing Insert mode completion it's possible that b_sfname is NULL.  Don't
give it to printf() for the "Scanning" message.

":set runtimepath-=$VIMRUNTIME" didn't work, because expansion of wildcards
was done after trying to remove the string.  Now for ":set opt+=val" and ":set
opt-=val" the expansion of wildcards is done before adding or removing "val".

Using CTRL-V with the "r" command with a blockwise Visual selection inserted a
CTRL-V instead of getting a special character.

Unix: Changed the order of libraries: Put -lXdmcp after -lX11 and -lSM -lICE
after -lXdmcp.  Should fix link problem on HP-UX 10.20.

Don't remove the last "-lm" from the link line.  Vim may link but fail later
when the GUI starts.

When the shell returns with an error when trying to expand wildcards, do
include the pattern when the "EW_NOTFOUND" flag was set.
When expanding wildcards with the shell fails, give a clear error message
instead of just "1 returned".

Selecting a Visual block, with the start partly on a Tab, deleting it leaves
the cursor too far to the left.  Causes "s" to work in the wrong position.

Pound sign in normal.c caused trouble on some compilers.  Use 0xA3 instead.

 vim:tw=78:
