Vim documentation: version6
main help file
*version6.txt* For Vim version 7.0. Last change: 2006 Apr 30
VIM REFERENCE MANUAL by Bram Moolenaar
Welcome to Vim Version 6.0! A large number of features has been added. This
file mentions all the new items that have been added, changes to existing
features and bug fixes compared to Vim 5.x.
See |vi_diff.txt| for an overview of differences between Vi and Vim 6.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 Vi compatible |substitute-CR|
global option values introduced |new-global-values|
'fileencoding' changed |fileencoding-changed|
Digraphs changed |digraphs-changed|
Filetype detection changed |filetypedetect-changed|
Unlisted buffers introduced |new-unlisted-buffers|
CTRL-U in Command-line mode changed |CTRL-U-changed|
Ctags gone |ctags-gone|
Documentation reorganized |documentation-6|
Modeless selection and clipboard |modeless-and-clipboard|
Small incompatibilities |incomp-small-6|
NEW FEATURES |new-6|
Folding |new-folding|
Vertically split windows |new-vertsplit|
Diff mode |new-diff-mode|
Easy Vim: click-and-type |new-evim|
User manual |new-user-manual|
Flexible indenting |new-indent-flex|
Extended search patterns |new-searchpat|
UTF-8 support |new-utf-8|
Multi-language support |new-multi-lang|
Plugin support |new-plugins|
Filetype plugins |new-filetype-plugins|
File browser |new-file-browser|
Editing files over a network |new-network-files|
Window for command-line editing |new-cmdwin|
Debugging mode |new-debug-mode|
Cursor in virtual position |new-virtedit|
Debugger interface |new-debug-itf|
Communication between Vims |new-vim-server|
Buffer type options |new-buftype|
Printing |new-printing|
Ports |ports-6|
Quickfix extended |quickfix-6|
Operator modifiers |new-operator-mod|
Search Path |new-search-path|
Writing files improved |new-file-writing|
Argument list |new-argument-list|
Restore a View |new-View|
Color schemes |new-color-schemes|
Various new items |new-items-6|
IMPROVEMENTS |improvements-6|
COMPILE TIME CHANGES |compile-changes-6|
BUG FIXES |bug-fixes-6|
VERSION 6.1 |version-6.1|
Changed |changed-6.1|
Added |added-6.1|
Fixed |fixed-6.1|
VERSION 6.2 |version-6.2|
Changed |changed-6.2|
Added |added-6.2|
Fixed |fixed-6.2|
VERSION 6.3 |version-6.3|
Changed |changed-6.3|
Added |added-6.3|
Fixed |fixed-6.3|
VERSION 6.4 |version-6.4|
Changed |changed-6.4|
Added |added-6.4|
Fixed |fixed-6.4|
==============================================================================
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. In vim 5.x the cursor position of the other
window would be used, which could be anywhere and was not very useful.
Substitute command Vi compatible *substitute-CR*
The substitute string (the "to" part of the substitute command) 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 before a line break. 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 no longer sets the '[
and '] marks. This is not related to Vi, since it doesn't have these marks.
Global option values introduced *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 option values from 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.
":let &opt = val" now sets the local and global values, like ":set". New
commands have been added to set the global or local value:
:let &opt = val like ":set"
:let &g:opt = val like ":setglobal"
:let &l:opt = val like ":setlocal"
'fileencoding' changed *fileencoding-changed*
'fileencoding' was used in Vim 5.x to set the encoding used inside all of Vim.
This was a bit strange, because it was local to a buffer and worked for all
buffers. It could never be different between buffers, because it changed the
way text in all buffers was interpreted.
It is now used for the encoding of the file related to the buffer. If you
still set 'fileencoding' it is likely to be overwritten by the detected
encoding from 'fileencodings', thus it is "mostly harmless".
The old FileEncoding autocommand now does the same as the new EncodingChanged
event.
Digraphs changed *digraphs-changed*
The default digraphs now correspond to RFC1345. This is very 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 (case is ignored). 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".
The distributed syntax files no longer contain "syntax clear". That makes it
possible to include one in the other without tricks. The syntax is now
cleared when the 'syntax' option is set (by an autocommand added from
synload.vim). This makes the syntax cleared when the value of 'syntax' does
not correspond to a syntax file. Previously the existing highlighting was
kept.
Unlisted buffers introduced *new-unlisted-buffers*
There is now a difference between buffers which don't appear in the buffer
list and buffers which are really not in the buffer list. Commands like
":ls", ":bnext", ":blast" and the Buffers menu will skip buffers not in the
buffer list. |unlisted-buffer|
The 'buflisted' option can be used to make a buffer appear in the buffer list
or not.
Several commands that previously added a buffer to the buffer list now create
an unlisted buffer. This means that a ":bnext" and ":ball" will not find these
files until they have actually been edited. For example, buffers used for the
alternative file by ":write file" and ":read file".
Other commands previously completely deleted a buffer and now only remove
the buffer from the buffer list. Commands relying on a buffer not to be
present might fail. For example, a ":bdelete" command in an autocommand that
relied on something following to fail (was used in the automatic tests).
|:bwipeout| can be used for the old meaning of ":bdelete".
The BufDelete autocommand event is now triggered when a buffer is removed from
the buffer list. The BufCreate event is only triggered when a buffer is
created that is added to the buffer list, or when an existing buffer is added
to the buffer list. BufAdd is a new name for BufCreate.
The new BufNew event is for creating any buffer and BufWipeout for really
deleting a buffer.
When doing Insert mode completion, only buffers in the buffer list are
scanned. Added the 'U' flag to 'complete' to do completion from unlisted
buffers.
Unlisted buffers are not stored in a viminfo file.
CTRL-U in Command-line mode changed *CTRL-U-changed*
Using CTRL-U when editing the command line cleared the whole line. Most
shells only delete the characters before the cursor. Made it work 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.
Ctags can be found here: http://ctags.sf.net/.
Documentation reorganized *documentation-6*
The documentation has been reorganized, an item may not be where you found it
in Vim 5.x.
- The user manual was added, some items have been moved to it from the
reference manual.
- The quick reference is now 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.
'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).
Modeless selection and clipboard *modeless-and-clipboard*
The modeless selection is used to select text when Visual mode can't be used,
for example when editing the command line or at the more prompt.
In Vim 5.x the modeless selection was always used. On MS-Windows this caused
the clipboard to be overwritten, with no way to avoid that. The modeless
selection now obeys the 'a' and 'A' flags in 'guioptions' and "autoselect" and
"autoselectml" in 'clipboard'. By default there is no automatic copy on
MS-Windows. Use the |c_CTRL-Y| command to manually copy the selection.
To get the old behavior back, do this:
:set clipboard^=autoselectml guioptions+=A
Small incompatibilities *incomp-small-6*
'backupdir', 'cdpath', 'directory', 'equalprg', 'errorfile', 'formatprg',
'grepprg', 'helpfile', 'makeef', 'makeprg', 'keywordprg', 'cscopeprg',
'viminfo' and 'runtimepath' can no longer be set from a modeline, for better
security.
Removed '_' from the 'breakat' default: It's commonly used in keywords.
The default for 'mousehide' is on, because this works well for 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).
Report 'modified' as changed when 'fileencoding' or 'fileformat' was set.
Thus it reflects the possibility to abandon the buffer without losing changes.
The "Save As" menu entry now edits the saved file. Most people expect it to
work like this.
A buffer for a directory is no longer added to the Buffers menu.
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.
Can map <Enter> just like <CR> or <Return>.
The default for the 'viminfo' option is now '20,"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.
The patterns in 'errorformat' would sometimes ignore case (MS-Windows) and
sometimes not (Unix). Now case is always ignored. Add "\C" to the pattern to
match case.
The 16 bit MS-DOS version is now compiled without the +listcmds feature
(buffer list manipulation commands). They are not often needed and this
executable needs to be smaller.
'sessionoptions' now includes "curdir" by default. This means that restoring
a session will result in the current directory being restored, instead of
going to the directory where the session file is located.
A session deleted all buffers, deleting all marks. Now keep the buffer list,
it shouldn't hurt for some existing buffers to remain present.
When the argument list is empty ":argdel *" caused an error message.
No longer put the search pattern from a tag jump in the history.
Use "SpecialKey" highlighting for unprintable characters instead of "NonText".
The idea is that unprintable text or any text that's displayed differently
from the characters in the file is using "SpecialKey", and "NonText" is used
for text that doesn't really exist in the file.
Motif now uses the system default colors for the menu and scrollbar. Used to
be grey. It's still possible to set the colors with ":highlight" commands and
resources.
Formatting text with "gq" breaks a paragraph at a non-empty blank line.
Previously the line would be removed, which wasn't very useful.
":normal" does no longer hang when the argument ends in half a command.
Previously Vim would wait for more characters to be typed, without updating
the screen. Now it pretends an <Esc> was typed.
Bitmaps for the toolbar are no longer searched for in "$VIM/bitmaps" but in
the "bitmaps" directories in 'runtimepath'.
Now use the Cmdline-mode menus for the hit-enter prompt instead of the Normal
mode menus. This generally works better and allows using the "Copy" menu to
produce CTRL-Y to copy the modeless selection.
Moved the font selection from the Window to the Edit menu, together with the
other settings.
The default values for 'isfname' include more characters to make "gf" work
better.
Changed the license for the documentation to the Open Publication License.
This seemed fair, considering the inclusion of parts of the Vim book, which is
also published under the OPL. The downside is that we can't force someone who
would sell copies of the manual to contribute to Uganda.
After "ayy don't let ""yy or :let @" = val overwrite the "a register.
Use the unnamed register instead.
MSDOS: A pattern "*.*" previously also matched a file name without a dot.
This was inconsistent with other versions.
In Insert mode, CTRL-O CTRL-\ CTRL-N {cmd} remains in Normal mode. Previously
it would go back to Insert mode, thus confusing the meaning of CTRL-\ CTRL-N,
which is supposed to take us to Normal mode (especially in ":amenu").
Allow using ":" commands after an operator. Could be used to implement a new
movement command. Thus it no longer aborts a pending operator.
For the Amiga the "-d {device}" argument was possible. When compiled with the
diff feature, this no longer works. Use "-dev {device}" instead. |-dev|
Made the default mappings for <S-Insert> in Insert mode insert the text
literally, avoids that special characters like BS cause side effects.
Using ":confirm" applied to the rest of the line. Now it applies only to the
command right after it. Thus ":confirm if x | edit | endif" no longer works,
use ":if x | confirm edit | endif". This was the original intention, that it
worked differently was a bug.
==============================================================================
NEW FEATURES *new-6*
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 yank, delete and put
folded text, for example to move a function to another position.
There is a whole bunch of new commands and options related to folding.
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 (see
|new-diff-mode|). 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 opened at the top, like ":topleft" was used, if the current
window is fewer than 80 characters wide.
A few options can be used to set the preferences for vertically split windows.
They work similar to their existing horizontal equivalents:
horizontal vertical
'splitbelow' 'splitright'
'winheight' 'winwidth'
'winminheight' 'winminwidth'
It's possible to set 'winminwidth' to zero, so that temporarily 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)
"-O" command line argument: Like "-o" but split windows vertically. (Scott
Urban)
Added commands to move the current window to the very top (CTRL-W K), bottom
(CTRL-W J), left (CTRL-W H) and right (CTRL-W L). In the new position the
window uses the full width/height of the screen.
When there is not enough room in the status line for both the file name and
the ruler, use up to half the width for the ruler. Useful for narrow windows.
Diff mode *new-diff-mode*
In diff mode Vim shows the differences between two, three or four files.
Folding is used to hide the parts of the file that are equal.
Highlighting is used to show deleted and changed lines.
See |diff-mode|.
An easy way to start in diff mode is to start Vim as "vimdiff file1 file2".
Added the vimdiff manpage.
In a running Vim the |:diffsplit| command starts diff mode for the current
file and another file. The |:diffpatch| command starts diff mode using the
current file and a patch file. The |:diffthis| command starts diff mode for
the current window.
Differences can be removed with the |:diffget| and |:diffput| commands.
- The 'diff' option switches diff mode on in a window.
- The |:diffupdate| command refreshes the diffs.
- The 'diffopt' option changes how diffs are displayed.
- The 'diffexpr' option can be set how a diff is to be created.
- The 'patchexpr' option can be set how patch is applied to a file.
- Added the "diff" folding method. When opening a window for diff-mode, set
'foldlevel' to zero and 'foldenable' on, to close the folds.
- Added the DiffAdd, DiffChange, DiffDelete and DiffText highlight groups to
specify the highlighting for differences. The defaults are ugly...
- Unix: make a vimdiff symbolic link for "make install".
- Removed the now obsolete "vimdiff.vim" script from the distribution.
- Added the "[c" and "]c" commands to move to the next/previous change in diff
mode.
Easy Vim: click-and-type *new-evim*
eVim stands for "Easy Vim". This is a separate program, but can also be
started as "vim -y".
This starts Vim with 'insertmode' set to allow click-and-type editing. The
$VIMRUNTIME/evim.vim script is used to add mappings and set options to be able
to do most things like Notepad. This is only for people who can't stand two
modes.
eView does the same but in readonly mode.
In the GUI a CTRL-C now only interrupts when busy with something, not when
waiting for a character. Allows using CTRL-C to copy text to the clipboard.
User manual *new-user-manual*
The user manual has been added. It is organised around editing tasks. It
reads like a book, from start to end. It should allow beginners to start
learning Vim. It helps everybody to learn using the most useful Vim features.
It is much easier to read than the reference manual, but omits details. See
|user-manual|.
The user manual includes parts of the Vim book by Steve Oualline |frombook|.
It is published under the OPL |manual-copyright|.
When syntax highlighting is not enabled, the characters in the help file which
mark examples ('>' and '<') and header lines ('~') are replaced with a space.
When closing the help window, the window layout is restored from before
opening it, if the window layout didn't change since then.
When opening the help window, put it at the top of the Vim window if the
current window is fewer than 80 characters and not full width.
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 ":filetype indent on" command enables using the provided indent scripts.
This is explained in the user manual: |30.3|.
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*
Added the possibility to match more than one line with a pattern. (partly by
Loic Grenie)
New items in a search pattern for multi-line matches:
\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
\_^ match start-of-line, can be used anywhere in the regexp
\_$ match end-of-line, can be used anywhere in the regexp
Various other new items in search patterns:
\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
\v make following characters "very magic"
\V make following characters "very nomagic"
\@! don't match atom before this.
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 preceding atom before the current position
\@<= match preceding atom before the current position
\@> match preceding atom as a subexpression
\& match only when branch before and after it match
\%[] optionally match a list of atoms; "end\%[if]" matches "end",
"endi" and "endif"
\%(\) like \(\), but without creating a back-reference; there can be
any number of these, overcomes the limit of nine \( \) pairs
\%^ match start-of-file (Chase Tingley)
\%$ match end-of-file (Chase Tingley)
\%# Match with the cursor position. (Chase Tingley)
\? Just like "\=" but can't be used in a "?" command.
\%23l match in line 23
\%<23l match before line 23
\%>23l match after line 23
\%23c, \%<23c, \%>23c match in/before/after column 23
\%23v, \%<23v, \%>23v match in/before/after virtual column 23
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 support to match multi-byte characters. (partly by Muraoka Taro)
Made "\<" and "\>" work for UTF-8. (Muraoka Taro)
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-wide characters are also supported. See |UTF-8|.
UCS-2, UCS-4 and UTF-16 encodings are supported too, they are converted to
UTF-8 internally. There is also support for editing Unicode files in a Latin1
environment. Other encodings are converted with iconv() or an external
converter specified with 'charconvert'.
Many new items for Multi-byte support:
- Added 'encoding' option: specifies character encoding used inside Vim. It
can be any 8-bit encoding, some double-byte encodings or Unicode.
It is initialized from the environment when a supported value is found.
- Added 'fileencoding' and 'fileencodings': specify character coding in a
file, similar to 'fileformat' and 'fileformats'.
When 'encoding' is "utf-8" and 'fileencodings' is "utf-8,latin1" this will
automatically switch to latin1 if a file does not contain valid UTF-8.
- Added 'bomb' option and detection of a BOM at the start of a file. Can be
used with "ucs-bom" in 'fileencodings' to automatically detect a Unicode
file if it starts with a BOM. Especially useful on MS-Windows (NT and
2000), which uses ucs-2le files with a BOM (e.g., when exporting the
registry).
- Added the 'termencoding' option: Specifies the encoding used for the
terminal. Useful to put Vim in utf-8 mode while in a non-Unicode locale:
:let &termencoding = &encoding
:set encoding=utf-8
- When 'viminfo' contains the 'c' flag, the viminfo file is converted from the
'encoding' it was written with to the current 'encoding'.
- Added ":scriptencoding" command: convert lines in a sourced script to
'encoding'. Useful for menu files.
- Added 'guifontwide' to specify a font for double-wide characters.
- Added Korean support for character class detection. Also fix cls() in
search.c. (Chong-Dae Park)
- Win32: Typing multi-byte characters without IME. (Alexander Smishlajev)
- Win32 with Mingw: compile with iconv library. (Ron Aaron)
- Win32 with MSVC: dynamically load iconv.dll library. (Muraoka Taro)
- Make it possible to build a version with multi-byte and iconv support with
Borland 5.5. (Yasuhiro Matsumoto)
- Added 'delcombine' option: Delete combining character separately. (Ron
Aaron)
- The "xfontset" feature isn't required for "xim". These are now two
independent features.
- XIM: enable XIM when typing a language character (Insert mode, Search
pattern, "f" or "r" command). Disable XIM when typing a Normal mode
command.
- When the XIM is active, show "XIM" in the 'showmode' message. (Nam SungHyun)
- Support "CursorIM" for XIM. (Nam SungHyun)
- Added 'm' flag to 'formatoptions': When wrapping words, allow splitting at
each multibyte character, not only at a space.
- Made ":syntax keyword" work with multi-byte characters.
- Added support for Unicode upper/lowercase flipping and comparing. (based on
patch by Raphael Finkel)
Let "~" on multi-byte characters that have a third case ("title case")
switch between the three cases. (Raphael Finkel)
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.
Added Language mapping and 'keymap' to be able to type multi-byte characters:
- Added the ":lmap" command and friends: Define mappings that are used when
typing characters in the language of the text. Also for "r", "t", etc. In
Insert and Command-line mode CTRL-^ switches the use of the mappings on/off.
CTRL-^ also toggles the use of an input method when no language mappings are
present. Allows switching the IM back on halfway typing.
- "<char-123>" argument to ":map", allows to specify the decimal, octal or
hexadecimal value of a character.
- Implemented the 'keymap' option: Load a keymap file. Uses ":lnoremap" to
define mappings for the keymap. The new ":loadkeymap" command is used in
the keymap file.
- Added 'k' flag in 'statusline': Value of "b:keymap_name" or 'keymap' when
it's being used. Uses "<lang>" when no keymap is loaded and ":lmap"s are
active. Show this text in the default statusline too.
- Added the 'iminsert' and 'imsearch' options: Specify use of langmap mappings
and Input Method with an option. (Muraoka Taro)
Added 'imcmdline' option: When set the input method is always enabled when
starting to edit a command line. Useful for a XIM that uses dead keys to
type accented characters.
Added 'imactivatekey' option to better control XIM. (Muraoka Taro)
- When typing a mapping that's not finished yet, display the last character
under the cursor in Insert mode and Command-line mode. Looks good for dead
characters.
- Made the 'langmap' option recognize multi-byte characters. But mapping only
works for 8-bit characters. Helps when using UTF-8.
- Use a different cursor for when ":lmap" mappings are active. Can specify
two highlight groups for an item in 'guicursor'. By default "lCursor" and
"Cursor" are equal, the user must set a color he likes.
Use the cursor color for hangul input as well. (Sung-Hyun Nam)
- Show "(lang)" for 'showmode' when language mapping is enabled.
- UTF-8: Made "r" work with a ":lmap" that includes a composing character.
Also works for "f", which now works to find a character that includes a
composing character.
Other multi-byte character additions:
- Support double-byte single-width characters for euc-jp: Characters starting
with 0x8E. Added ScreenLines2[] to store the second byte.
Multi-language support *new-multi-lang*
The messages used in Vim can be translated. Several translations are
available. This uses the gettext mechanism. It allows adding a translation
without recompiling Vim. |multi-lang| (partly by Marcin Dalecki)
The translation files are in the src/po directory. The src/po/README.txt file
explains a few things about doing a translation.
Menu translations are available as well. This uses the new |:menutranslate|
command. The translations are found in the runtime directory "lang". This
allows a user to add a translation.
Added |:language| command to set the language (locale) for messages, time and
character type. This allows switching languages in Vim without changing the
locale outside of Vim.
Made it possible to have vimtutor use different languages. (Eduardo Fernandez)
Spanish (Eduardo Fernandez), Italian (Antonio Colombo), Japanese (Yasuhiro
Matsumoto) and French (Adrien Beau) translations are included.
Added "vimtutor.bat": script to start Vim on a copy of the tutor file for
MS-Windows. (Dan Sharp)
- Added v:lang variable to be able to get current language setting.
(Marcin Dalecki) Also v:lc_time and v:ctype.
- Make it possible to translate the dialogs used by the menus. Uses global
"menutrans_" variables. ":menutrans clear" deletes them.
- removed "broken locale" (Marcin Dalecki).
- Don't use color names in icons, use RGB values. The names could be
translated.
- Win32: Added global IME support (Muraoka)
- Win32: Added dynamic loading of IME support.
- ":messages" prints a message about who maintains the messages or the
translations. Useful to find out where to make a remark about a wrong
translation.
- --disable-nls argument for configure: Disable use of gettext(). (Sung-Hyun
Nam)
- Added NLS support for Win32 with the MingW compiler. (Eduardo Fernandez)
- When available, call bind_textdomain_codeset() to have gettext() translate
messages to 'encoding'. This requires GNU gettext 0.10.36 or later.
- Added gettext support for Win32. This means messages will be translated
when the locale is set and libintl.dll can be found. (Muraoka Taro)
Also made it work with MingW compiler. (Eduardo Fernandez)
Detect the language and set $LANG to get the appropriate translated messages
(if supported). Also use $LANG to select a language, v:lang is a very
different kind of name.
- Made gvimext.dll use translated messages, if possible. (Yasuhiro Matsumoto)
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 |new-network-files|
gzip.vim - Edit compressed files
explorer.vim - Browse directories |new-file-browser|
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.
Added the <unique> argument to ":map": only add a mapping when it wasn't
defined before.
When displaying an option value with 'verbose' set will give a message about
where the option was last set. Very useful to find out which script did set
the value.
The new |:scriptnames| command displays a list of all scripts that have been
sourced.
GUI: For Athena, Motif and GTK look for a toolbar bitmap in the "bitmaps"
directories in 'runtimepath'. Allows adding your own bitmaps.
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. They are kept between
invocations of the same script. |s:var|
- 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" sets or displays the global value for a local option.
":setlocal name<" sets a local option to its global value.
- Added the buffer-local value for some global options: 'equalprg', 'makeprg',
'errorformat', 'grepprg', 'path', 'dictionary', 'thesaurus', 'tags',
'include' and 'define'. This allows setting a local value for these global
options, without making it incompatible.
- 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.
File browser *new-file-browser*
When editing a directory, the explorer plugin will list the files in the
directory. Pressing <Enter> on a file name edits that file. Pressing <Enter>
on a directory moves the browser to that directory.
There are several other possibilities, such as opening a file in the preview
window, renaming files and deleting files.
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.
GTK: Allow dropping a http:// and ftp:// URL on Vim. The netrw plugin takes
care of downloading the file. (MiKael Berthe)
Window for command-line editing *new-cmdwin*
The Command-line window can be used to edit a command-line with Normal and
Insert mode commands. When it is opened it contains the history. This allows
copying parts of previous command lines. |cmdwin|
The command-line window can be opened from the command-line with the key
specified by the 'cedit' option (like Nvi). It can also be opened directly
from Normal mode with "q:", "q/" and "q?".
The 'cmdwinheight' is used to specify the initial height of the window.
In Insert mode CTRL-X CTRL-V can be used to complete an Ex command line, like
it's done on the command-line. This is also useful for writing Vim scripts!
Additionally, there is "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)
Debugging mode *new-debug-mode*
In debugging mode sourced scripts and user functions can be executed line by
line. There are commands to step over a command or step into it. |debug-mode|
Breakpoints can be set to run until a certain line in a script or user
function is executed. |:breakadd|
Debugging can be started with ":debug {cmd}" to debug what happens when a
command executes. The |-D| argument can be used to debug while starting up.
Cursor in virtual position *new-virtedit*
Added the 'virtualedit' option: Allow positioning the cursor where there is no
actual character in Insert mode, Visual mode or always. (Matthias Kramm)
This is especially useful in Visual-block mode. It allows positioning a
corner of the area where there is no text character. (Many improvements by
Chase Tingley)
Debugger interface *new-debug-itf*
This was originally made to work with Sun Visual Workshop. (Gordon Prieur)
See |debugger.txt|, |sign.txt| and |workshop.txt|.
Added the ":sign" command to define and place signs. They can be displayed
with two ASCII characters or an icon. The line after it can be highlighted.
Useful to display breakpoints and the current PC position.
Added the |:wsverb| command to execute debugger commands.
Added balloon stuff: 'balloondelay' and 'ballooneval' options.
Added "icon=" argument for ":menu". Allows defining a specific icon for a
ToolBar item.
Communication between Vims *new-vim-server*
Added communication between two Vims. Makes it possible to send commands from
one Vim to another. Works for X-Windows and MS-Windows |clientserver|.
Use "--remote" to have files be edited in an already running Vim.
Use "--remote-wait" to do the same and wait for the editing to finish.
Use "--remote-send" to send commands from one Vim to another.
Use "--remote-expr" to have an expression evaluated in another Vim.
Use "--serverlist" to list the currently available Vim servers. (X only)
There are also functions to communicate between the server and the client.
|remote_send()| |remote_expr()|
(X-windows version implemented by Flemming Madsen, MS-Windows version by Paul
Moore)
Added the command server name to the window title, so you can see which server
name belongs to which Vim.
Removed the OleVim directory and SendToVim.exe and EditWithVim.exe from the
distribution. Can now use "gvim --remote" and "gvim --remote-send", which is
portable.
GTK+: Support running Vim inside another window. Uses the --socketid argument
(Neil Bird)
Buffer type options *new-buftype*
The 'buftype' and 'bufhidden' options have been added. They can be set to
have different kinds of buffers. For example:
- 'buftype' = "quickfix": buffer with error list
- 'buftype' = "nofile" and 'bufhidden' = "delete": scratch buffer that will be
deleted as soon as there is no window displaying it.
'bufhidden' can be used to overrule the 'hidden' option for one buffer.
In combination with 'buflisted' and 'swapfile' this offers the possibility to
use various kinds of special buffers. See |special-buffers|.
Printing *new-printing*
Included first implementation of the ":hardcopy" command for printing
to paper. For MS-Windows any installed printer can be used. For other
systems a PostScript file is generated, which can be printed with the
'printexpr' option.
(MS-Windows part by Vince Negri, Vipin Aravind, PostScript by Vince Negri and
Mike Williams)
Made ":hardcopy" work with multi-byte characters. (Muraoka Taro, Yasuhiro
Matsumoto)
Added options to tune the way printing works: (Vince Negri)
- 'printoptions' defines various things.
- 'printheader' specifies the header format. Added "N" field to 'statusline'
for the page number.
- 'printfont' specifies the font name and attributes.
- 'printdevice' defines the default printer for ":hardcopy!".
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)
Port to QNX. Supports the Photon GUI, mouse, etc. (Julian Kinraid)
Allow cross-compiling the Win32 version with Make_ming.mak. (Ron Aaron)
Added Python support for compiling with Mingw. (Ron Aaron)
Dos 32 bit: Added support the Windows clipboard. (David Kotchan)
Win32: Dynamically load Perl and Python. Allows compiling Vim with these
interfaces and will try to find the DLLs at runtime. (Muraoka Taro)
Compiling the Win32 GUI with Cygwin. Also compile vimrun, dosinst and
uninstall. (Gerfried)
Mac: Make Vim compile with the free MPW compiler supplied by Apple. And
updates for CodeWarrior. (Axel Kielhorn)
Added typecasts and ifdefs as a start to make Vim work on Win64 (George
Reilly)
Quickfix extended *quickfix-6*
Added the "error window". It contains all the errors of the current error
list. Pressing <Enter> in a line makes Vim jump to that line (in another
window). This makes it easy to navigate through the error list.
|quickfix-window|.
- |:copen| opens the quickfix window.
- |:cclose| closes the quickfix window.
- |:cwindow| takes care that there is a quickfix window only when there are
recognized errors. (Dan Sharp)
- 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)
- When using "%f" in 'errorformat' on a DOS/Windows system, also include "c:"
in the filename, even when using "%f:".
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*
Vim can search in a directory tree not only in downwards but also upwards.
Works for the 'path', 'cdpath' and 'tags' options. (Ralf Schandl)
Also use "**" for 'tags' option. (Ralf Schandl)
Added 'includeexpr', can be used to modify file name found by 'include'
option.
Also use 'includeexpr' for "gf" and "<cfile>" when the file can't be found
without modification. Useful for doing "gf" on the name after an include or
import statement.
Added the 'cdpath' option: Locations to find a ":cd" argument. (Raf)
Added the 'suffixesadd' option: Suffixes to be added to a file name when
searching for a file for the "gf", "[I", etc. commands.
Writing files improved *new-file-writing*
Added the 'backupcopy' option: Select whether a file is to be 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 list of file patterns to skip making a backup
file when it matches. The default for Unix includes "/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).
ACL is also supported for AIX, Solaris and generic POSIX. (Tomas Ogren)
And on SGI.
Argument list *new-argument-list*
The support for the argument list has been extended. It can now be
manipulated to contain the files you want it to contain.
The argument list can now be local to a window. It is created with the
|:arglocal| command. The |:argglobal| command can be used to go back to the
global argument list.
The |:argdo| command executes a command on all files in the argument list.
File names can be added to the argument list with |:argadd|. File names can
be removed with |:argdelete|.
"##" can be used like "#", it is replaced by all the names in the argument
list concatenated. Useful for ":grep foo ##".
The |:argedit| adds a file to the argument list and edits it. Like ":argadd"
and then ":edit".
Restore a View *new-View*
The ":mkview" command writes a Vim script with the settings and mappings for
one window. When the created file is sourced, the view of the window is
restored. It's like ":mksession" for one window.
The View also contains the local argument list and manually created, opened
and closed folds.
Added the ":loadview" command and the 'viewdir' option: Allows for saving and
restoring views of a file with simple commands. ":mkview 1" saves view 1 for
the current file, ":loadview 1" loads it again. Also allows quickly switching
between two views on one file. And saving and restoring manual folds and the
folding state.
Added 'viewoptions' to specify how ":mkview" works.
":mksession" now also works fine with vertical splits. It has been further
improved and restores the view of each window. It also works properly with
preview and quickfix windows.
'sessionoptions' is used for ":mkview" as well.
Added "curdir" and "sesdir" to 'sessionoptions'. Allows selection of what
the current directory will be restored to.
The session file now also contains the argument list(s).
Color schemes *new-color-schemes*
Support for loading a color scheme. Added the ":colorscheme" command.
Automatically add menu entries for available schemes.
Should now properly reset the colors when 'background' or 't_Co' is changed.
":highlight clear" sets the default colors again.
":syntax reset" sets the syntax highlight colors back to the defaults.
For ":set bg&" guess the value. This allows a color scheme to switch back to
the default colors.
When syntax highlighting is switched on and a color scheme was defined, reload
the color scheme to define the colors.
Various new items *new-items-6*
Normal mode commands:
"gi" Jump to the ^ mark and start Insert mode. Also works when the
mark is just after the line. |gi|
"g'm" and "g`m"
Jump to a mark without changing the jumplist. Now you can use
g`" to jump to the last known position in a file without side
effects. Also useful in mappings.
[', [`, ]' and ]`
move the cursor to the next/previous lowercase mark.
g_ Go to last non-blank in line. (Steve Wall)
Options:
'autoread' When detected that a file changed outside of Vim,
automatically read a buffer again when it's not changed.
It has a global and a local value. Use ":setlocal autoread<"
to go back to using the global value for 'autoread'.
'debug' When set to "msg" it will print error messages that would
otherwise be omitted. Useful for debugging 'indentexpr' and
'foldexpr'.
'lispwords' List of words used for lisp indenting. It was previously hard
coded. Added a number of Lisp names to the default.
'fold...' Many new options for folding.
'modifiable' When off, it is impossible to make changes to a buffer.
The %m and %M items in 'statusline' show a '-'.
'previewwindow' Set in the preview window. Used in a session file to mark a
window as the preview window.
'printfont'
'printexpr'
'printheader'
'printdevice'
'printoptions' for ":hardcopy".
'buflisted' Makes a buffer appear in the buffer list or not.
Use "vim{version}:" for modelines, only to be executed when the version is
>= {version}. Also "vim>{version}", "vim<{version}" and "vim={version}".
Ex commands:
:sav[eas][!] {file}
Works like ":w file" and ":e #", but without loading the file
again and avoiding other side effects. |:saveas|
:silent[!] {cmd}
Execute a command silently. Also don't use a delay that would
come after the message. And don't do 'showmatch'.
RISCOS: Removed that "!~cmd" didn't output anything, and
didn't wait for <Enter> afterwards. Can use ":silent !cmd"
now.
:menu <silent> Add a menu that won't echo Ex commands.
:map <silent> Add a mapping that won't echo Ex commands.
:checktime Check for changed buffers.
:verbose {cmd} Set 'verbose' for one command.
:echomsg {expr}
:echoerr {expr} Like ":echo" but store the message in the history. (Mark
Waggoner)
:grepadd Works just like ":grep" but adds to the current error list
instead of defining a new list. |:grepadd|
:finish Finish sourcing a file. Can be used to skip the rest of a Vim
script. |:finish|
:leftabove
:aboveleft Split left/above current window.
:rightbelow
:belowright Split right/below current window.
: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".
:match Define match highlighting local to a window. Allows
highlighting an item in the current window without interfering
with syntax highlighting.
:menu enable
:menu disable Commands to enable/disable menu entries without removing them.
(Monish Shah)
:windo Execute a command in all windows.
:bufdo Execute a command in all buffers.
:wincmd Window (CTRL-W) command. Useful when a Normal mode command
can't be used (e.g., for a CursorHold autocommand). See
|CursorHold-example| for a nice application with it.
: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.
:redraw Redraw the screen even when busy with a script or function.
:hardcopy Print to paper.
:compiler Load a Vim script to do settings for a specific compiler.
:z# List numbered lines. (Bohdan Vlasyuk)
New marks:
'( and ') Begin or end of current sentence. Useful in Ex commands.
'{ and '} Begin or end of current paragraph. Useful in Ex commands.
'. Position of the last change in the current buffer.
'^ Position where Insert mode was stopped.
Store the ^ and . marks in the viminfo file. Makes it possible to jump to the
last insert position or changed text.
New functions:
argidx() Current index in argument list.
buflisted() Checks if the buffer exists and has 'buflisted' set.
cindent() Get indent according to 'cindent'.
eventhandler() Returns 1 when inside an event handler and interactive
commands can't be used.
executable() Checks if a program or batch script can be executed.
filewritable() Checks if a file can be written. (Ron Aaron)
foldclosed() Find out if there is a closed fold. (Johannes Zellner).
foldcloseend() Find the end of a closed fold.
foldlevel() Find out the foldlevel. (Johannes Zellner)
foreground() Move the GUI window to the foreground.
getchar() Get one character from the user. Can be used to define a
mapping that takes an argument.
getcharmod() Get last used key modifier.
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)
globpath() Find matching files in a list of directories.
hasmapto() Detect if a mapping to a string is already present.
iconv() Convert a string from one encoding to another.
indent() gets the indent of a line (Ron Aaron)
inputdialog() Like input() but use a GUI dialog when possible. Currently
only works for Win32, Motif, Athena and GTK.
Use inputdialog() for the Edit/Settings/Text Width menu. Also
for the Help/Find.. and Toolbar FindHelp items.
(Win32 support by Thore B. Karlsen)
(Win16 support by Vince Negri)
inputsecret() Ask the user to type a string without showing the typed keys.
(Charles Campbell)
libcall() for Unix (Neil Bird, Johannes Zellner, Stephen Wall)
libcallnr() for Win32 and Unix
lispindent() Get indent according to 'lisp'.
mode() Return a string that indicates the current mode.
nextnonblank() Skip blank lines forwards.
prevnonblank() Skip blank lines backwards. Useful to for indent scripts.
resolve() MS-Windows: resolve a shortcut to the file it points to.
Unix: resolve a symbolic link.
search() Search for a pattern.
searchpair() Search for matching pair. Can be used in indent files to find
the "if" matching an endif.
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-lowercase.
toupper() Convert string to all-uppercase.
type() Check the type of an expression.
wincol() window column of the cursor
winwidth() Width of a window. (Johannes Zellner)
winline() window line of the cursor
Added expansion of curly braces in variable and function names. This can be
used for variable names that include the value of an option. Or a primitive
form of arrays. (Vince Negri)
New autocommand events:
BufWinEnter Triggered when a buffer is displayed in a window, after using
the modelines. Can be used to load a view.
BufWinLeave Triggered when a buffer is no longer in a window. Also
triggered when exiting Vim. Can be used to save views.
FileChangedRO Triggered before making the first change to a read-only file.
Can be used to check-out the file. (Scott Graham)
TermResponse Triggered when the terminal replies to the version-request.
The v:termresponse internal variable holds the result. Can be
used to react to the version of the terminal. (Ronald Schild)
FileReadCmd Triggered before reading a file.
BufReadCmd Triggered before reading a file into a buffer.
FileWriteCmd Triggered before writing a file.
BufWriteCmd Triggered before writing a buffer into a file.
FileAppendCmd Triggered before appending to a file.
FuncUndefined Triggered when a user function is not defined. (Ron Aaron)
The autocommands for the *Cmd events read or write the file instead of normal
file read/write. Use this in netrw.vim to be able to edit files on a remote
system. (Charles Campbell)
New Syntax files:
bdf BDF font definition (Nikolai Weibull)
catalog SGML catalog (Johannes Zellner)
debchangelog Debian Changelog (Wichert Akkerman)
debcontrol Debian Control (Wichert Akkerman)
dot dot (Markus Mottl)
dsl DSSSL syntax (Johannes Zellner)
eterm Eterm configuration (Nikolai Weibull)
indent Indent profile (Nikolai Weibull)
lftp LFTP (Nikolai Weibull)
lynx Lynx config (Doug Kearns)
mush mush sourcecode (Bek Oberin)
natural Natural (Marko Leipert)
pilrc Pal resource compiler (Brian Schau)
plm PL/M (Philippe Coulonges)
povini Povray configuration (David Necas)
ratpoison Ratpoison config/command (Doug Kearns)
readline readline config (Nikolai Weibull)
screen Screen RC (Nikolai Weibull)
specman Specman (Or Freund)
sqlforms SQL*Forms (Austin Ziegler)
terminfo terminfo (Nikolai Weibull)
tidy Tidy configuration (Doug Kearns)
wget Wget configuration (Doug Kearns)
Updated many syntax files to work both with Vim 5.7 and 6.0.
Interface to Ruby. (Shugo Maeda)
Support dynamic loading of the Ruby interface on MS-Windows. (Muraoka Taro)
Support this for Mingw too. (Benoit Cerrina)
Win32: Added possibility to load TCL dynamically. (Muraoka Taro)
Also for Borland 5.5. (Dan Sharp)
Win32: When editing a file that is a shortcut (*.lnk file), edit the file it
links to. Unless 'binary' is set, then edit the shortcut file itself.
(Yasuhiro Matsumoto)
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.
Added the CTRL-W P command: go to 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%".
"-S session.vim" argument: Source a script file when starting up. Convenient
way to start Vim with a session file.
Added "--cmd {command}" Vim argument to execute a command before a vimrc file
is loaded. (Vince Negri)
Added the "-M" Vim argument: reset 'modifiable' and 'write', thus disallow
making changes and writing files.
Added runtime/delmenu.vim. Source this to remove all menus and prepare for
loading new menus. Useful when changing 'langmenu'.
Perl script to filter Perl error messages to quickfix usable format. (Joerg
Ziefle)
Added runtime/macros/less.vim: Vim script to simulate less, but with syntax
highlighting.
MS-Windows install program: (Jon Merz)
- The Win32 program can now create shortcuts on the desktop and install Vim in
the Start menu.
- Possibly remove old "Edit with Vim" entries.
- The Vim executable is never moved or $PATH changed. A small batch file is
created in a directory in $PATH. Fewer choices to be made.
- Detect already installed Vim versions and offer to uninstall them first.
Improved the MS-Windows uninstal program. It now also deletes the entries in
the Start menu, icons from the desktop and the created batch files. (Jon Merz)
Also made it possible to delete only some of these. Also unregister gvim for
OLE.
Generate a self-installing Vim package for MS-Windows. This uses NSIS. (Jon
Merz et al.)
Added ":filetype detect". Try detecting the filetype again. Helps when
writing a new shell script, after adding "#!/bin/csh".
Added ":augroup! name" to delete an autocommand group. Needed for the
client-server "--remote-wait".
Add the Vim version number to the viminfo file, useful for debugging.
==============================================================================
IMPROVEMENTS *improvements-6*
Added the 'n' flag in 'cpoptions': When omitted text of wrapped lines is not
put between line numbers from 'number' option. Makes it a lot easier to read
wrapped lines.
When there is a format error in a tags file, the byte position is reported so
that the error can be located.
"gf" works in Visual mode: Use the selected text as the file name. (Chase
Tingley)
Allow ambiguous mappings. Thus "aa" and "aaa" can both be mapped, the longest
matching one is used. Especially useful for ":lmap" and 'keymap'.
Encryption: Ask the key to be typed twice when crypting the first time.
Otherwise a typo might cause the text to be lost forever. (Chase Tingley)
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. "-" is added for a file with 'modifiable' off.
In Visual mode, mention the size of the selected area in the 'showcmd'
position.
Added the "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
the result of an expression. From this expression the submatch() function can
be used to access submatches.
When doing ":qall" and there is a change in a buffer that is being edited in
another window, jump to that window, instead of editing that buffer in the
current window.
Added the "++enc=" and "++ff=" arguments to file read/write commands to force
using the given 'encoding' or 'fileformat'. And added the "v:cmdarg"
variable, to be used for FileReadCmd autocommands that read/write the file
themselves.
When reading stdin, first read the text in binary mode and then re-read it
with automatic selection of 'fileformat' and 'fileencoding'. This avoids
problems with not being able to rewind the file (e.g., when a line near the
end of the file ends in LF instead of CR-LF).
When reading text from stdin and the buffer is empty, don't mark it changed.
Allows exiting without trouble.
Added an ID to many error messages. This will make it easier to find help for
a message.
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.
- Added Thesaurus completion with CTRL-X CTRL-T. (Vince Negri)
- Added the 'thesaurus' option, to use instead of 'dictionary' for thesaurus
completion. Added the 's' flag in 'complete'.
- Made CTRL-X CTRL-L in Insert mode use the 'complete' option. It now also
scans other loaded buffers for matching lines.
- CTRL-R now also works in Insert mode while doing completion with CTRL-X or
CTRL-N. (Neil Bird)
- When doing Insert mode completion, when completion is finished check for a
match with words from 'cinkeys' or 'indentkeys'.
Performance:
- Made display updating more efficient. Insert/delete lines may be used for
all changes, also for undo/redo.
- The 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.
- GUI and Dos32: Use a vertical scroll region, to make scrolling in a
vertically split window faster. No need to redraw the whole window.
- When scrolling isn't possible with terminal codes (e.g., for a vertically
split window) redraw from ScreenLines[]. That should be faster than going
through the lines with win_line(), especially when using syntax
highlighting.
- The Syntax menu is now pre-generated by a separate script. Makes loading
the menu 70% faster. This can halve the startup time of gvim.
- When doing ":help tag", don't open help.txt first, jump directly to the help
tag. It's faster and avoids an extra message.
- Win32: When a file name doesn't end in ".lnk" don't try resolving a
shortcut, it takes quite a bit of time.
- Don't update the mouse pointer shape while there are typeahead characters.
- Change META[] from a string into an array, avoids using strchr() on it.
- Don't clear the command line when adding characters, avoids that screen_fill
is called but doesn't do anything.
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.
- Disallow ":source <dirname>". On unix it's possible to read a directory,
does not make sense to use it as Vim commands.
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)
- Evaluating options which are an expression is done in a |sandbox|. If the
option was set by a modeline, it cannot cause damage.
- Use a secure way to generate temp file names: Create a private directory for
temp files. Used for Unix, MS-DOS and OS/2.
- 'makeef' can be empty, which means that an internally generated file name is
used. The old default was "/tmp/file", which is a security risk.
Writing 'makeef' in the current directory fails in a read-only directory and
causes trouble when using ":grep" on all files. Made the default empty for
all systems, so that a temp file is used.
- The command from a tags file is executed in the sandbox for better security.
- The Ruby, Tcl and Python interfaces cannot be used from the sandbox. They
might do dangerous things. Perl is still possible, but limited to the Safe
environment. (Donnie Smith)
Syntax highlighting:
- Optimized the speed by caching the state stack all over the file, not just
the part being displayed. Required for folding.
- Added ":syntax sync fromstart": Always parse from the start of the file.
- Added the "display" argument for syntax items: use the 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)
- Syntax items can have the "extend" argument to undo the effect of a
"keepend" argument of an item it is contained in. Makes it possible to have
some contained items extend a region while others don't.
- ":syntax clear" now deletes the b:current_syntax variable. That's logical,
since no syntax is defined after this command.
- Added ":syntax enable": switch on syntax highlighting without changing the
colors. This allows specifying the colors in the .vimrc file without the
need for a mysyntaxfile.
- Added ":syntax reset": reset the colors to their defaults.
- Added the "contains=TOP" and "contains=CONTAINED" arguments. Makes it
possible to define a transparent item that doesn't contain itself.
- Added a "containedin" argument to syntax items. Allows adding a contained
item to an existing item (e.g., to highlight a name in a comment).
Modeless selection:
- When in the command-line window, use modeless selection in the other
windows. Makes it possible to copy visible text to the command-line window.
- Support modeless selection on the cmdline in a terminal. Previously it was
only possible for the GUI.
- Make double-right-click in modeless selection select a whole word. Single
right click doesn't use the word selection started by a double-left-click.
Makes it work like in Visual mode.
- The modeless selection no longer has an implied automatic copy to the
clipboard. It now obeys the 'a' and 'A' flags in 'guioptions' or
"autoselect" and "autoselectml" in 'clipboard'.
- Added the CTRL-Y command in Cmdline-mode to copy the modeless selection to
the clipboard. Also works at the hit-enter prompt and the more prompt.
Removed the mappings in runtime/mswin.vim for CTRL-Y and CTRL-Z in
cmdline-mode to be able to use CTRL-Y in the new way.
Reduced the amount of stack space used by regmatch() to allow it to handle
complicated patterns on a longer text.
'isfname' now includes '%' and '#'. Makes "vim dir\#file" work for MS-DOS.
Added keypad special keys <kEnter>, <k0> - <k9>. When not mapped they behave
like the ASCII equivalent. (Ivan Wellesz and Vince Negri)
Recognize a few more xterm keys: <C-Right>, <C-Left>, <C-End>, <C-Home>
Also trigger the BufUnload event when Vim is going to exit. Perhaps a script
needs to do some cleaning up.
Expand expression in backticks: `={expr}`. Can be used where backtick
expansion is done. (Vince Negri)
GUI:
- Added 'L' and 'R' flags in 'guioptions': Add a left or right scrollbar only
when there is a vertically split window.
- 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)
- Added the 'linespace' option: Insert a pixel line between lines. (Nam)
- Allow modeless selection (without moving the cursor) by keeping CTRL and
SHIFT pressed. (Ivan Wellesz)
- Motif: added toolbar. (Gordon Prieur) Also added tooltips.
- Athena: added toolbar and tooltips. (David Harrison -- based on Gordon
Prieur's work)
- Made the 'toolbar' option work for Athena and Motif. Can now switch between
text and icons on the fly. (David Harrison)
- Support menu separator lines for Athena. (David Harrison)
- Athena: Adjust the arrow pixmap used in a pullright menu to the size of the
font. (David Harrison)
- Win32: Added "c" flag to 'guifont' to be able to specify the charset. (Artem
Khodush)
- When no --enable-xim argument is given, automatically enable it when a X GUI
is used. Required for dead key support (and multi-byte input).
- After a file selection dialog, check that the edited files were not changed
or deleted. The Win32 dialog allows deleting and renaming files.
- Motif and Athena: Added support for "editres". (Marcin Dalecki)
- Motif and Athena: Added "menuFont" to be able to specify a font or fontset
for the menus. Can also be set with the "Menu" highlight group. Useful
when the locale is different from 'encoding'. (David Harrison)
When FONTSET_ALWAYS is defined, always use a fontset for the menus. Should
avoid trouble with changing from a font to a fontset. (David Harrison)
- Highlighting and font for the tooltips can be specified with the "Tooltip"
highlight group. (David Harrison)
- The Cmdline-mode menus can be used at the more-prompt. This mostly works
fine, because they start with a CTRL-C. The "Copy" menu works to copy the
modeless selection. Allows copying the output of ":set all" or ":intro"
without auto-selection.
- When starting the GUI when there is no terminal connected to stdout and
stderr, display error messages in a dialog. Previousl