Help FAQ Both

Vim documentation: vi_diff

main help file

*vi_diff.txt*   For Vim version 7.3.  Last change: 2010 Oct 11


		  VIM REFERENCE MANUAL    by Bram Moolenaar



Differences between Vim and Vi				*vi-differences*

Throughout the help files differences between Vim and Vi/Ex are given in
curly braces, like "{not in Vi}".  This file only lists what has not been
mentioned in other files and gives an overview.

Vim is mostly POSIX 1003.2-1 compliant.  The only command known to be missing
is ":open".  There are probably a lot of small differences (either because Vim
is missing something or because Posix is beside the mark).

1. Simulated command			|simulated-command|
2. Missing options			|missing-options|
3. Limits				|limits|
4. The most interesting additions	|vim-additions|
5. Other vim features			|other-features|
6. Command-line arguments		|cmdline-arguments|
7. POSIX compliance			|posix-compliance|

==============================================================================

1. Simulated command					*simulated-command*

This command is in Vi, but Vim only simulates it:


							*:o* *:op* *:open*
:[range]o[pen]			Works like |:visual|: end Ex mode.
				{Vi: start editing in open mode}

:[range]o[pen] /pattern/	As above, additionally move the cursor to the
				column where "pattern" matches in the cursor
				line.

Vim does not support open mode, since it's not really useful.  For those
situations where ":open" would start open mode Vim will leave Ex mode, which
allows executing the same commands, but updates the whole screen instead of
only one line.

==============================================================================

2. Missing options					*missing-options*

These options are in the Unix Vi, but not in Vim.  If you try to set one of
them you won't get an error message, but the value is not used and cannot be
printed.


autoprint (ap)		boolean	(default on)		*'autoprint'* *'ap'*

beautify (bf)		boolean	(default off)		*'beautify'* *'bf'*

flash (fl)		boolean	(default ??)		*'flash'* *'fl'*

graphic (gr)		boolean	(default off)		*'graphic'* *'gr'*

hardtabs (ht)		number	(default 8)		*'hardtabs'* *'ht'*
	number of spaces that a <Tab> moves on the display

mesg			boolean	(default on)		*'mesg'*

novice			boolean	(default off)		*'novice'*

open			boolean	(default on)		*'open'*

optimize (op)		boolean	(default off)		*'optimize'* *'op'*

redraw			boolean	(default off)		*'redraw'*

slowopen (slow)		boolean	(default off)		*'slowopen'* *'slow'*

sourceany		boolean	(default off)		*'sourceany'*

w300			number	(default 23)		*'w300'*

w1200			number	(default 23)		*'w1200'*

w9600			number	(default 23)		*'w9600'*

==============================================================================

3. Limits						*limits*

Vim has only a few limits for the files that can be edited {Vi: can not handle
<Nul> characters and characters above 128, has limited line length, many other
limits}.

							*E340*
Maximum line length	   On machines with 16-bit ints (Amiga and MS-DOS real
			   mode): 32767, otherwise 2147483647 characters.
			   Longer lines are split.
Maximum number of lines	   2147483647 lines.
Maximum file size	   2147483647 bytes (2 Gbyte) when a long integer is
			   32 bits.  Much more for 64 bit longs.  Also limited
			   by available disk space for the |swap-file|.

							*E75*
Length of a file path	   Unix and Win32: 1024 characters, otherwise 256
			   characters (or as much as the system supports).
Length of an expanded string option
			   Unix and Win32: 1024 characters, otherwise 256
			   characters
Maximum display width	   Unix and Win32: 1024 characters, otherwise 255
			   characters
Maximum lhs of a mapping   50 characters.
Number of different highlighting types: over 30000
Range of a Number variable:  -2147483648 to 2147483647 (more on 64 bit
			   systems)
Maximum length of a line in a tags file: 512 bytes.

Information for undo and text in registers is kept in memory, thus when making
(big) changes the amount of (virtual) memory available limits the number of
undo levels and the text that can be kept in registers.  Other things are also
kept in memory:  Command-line history, error messages for Quickfix mode, etc.

Memory usage limits

The option 'maxmem' ('mm') is used to set the maximum memory used for one
buffer (in kilobytes).  'maxmemtot' is used to set the maximum memory used for
all buffers (in kilobytes).  The defaults depend on the system used.  For the
Amiga and MS-DOS, 'maxmemtot' is set depending on the amount of memory
available.
These are not hard limits, but tell Vim when to move text into a swap file.
If you don't like Vim to swap to a file, set 'maxmem' and 'maxmemtot' to a
very large value.  The swap file will then only be used for recovery.  If you
don't want a swap file at all, set 'updatecount' to 0, or use the "-n"
argument when starting Vim.

==============================================================================

4. The most interesting additions			*vim-additions*

Vi compatibility.					|'compatible'|
	Although Vim is 99% Vi compatible, some things in Vi can be
	considered to be a bug, or at least need improvement.  But still, Vim
	starts in a mode which behaves like the "real" Vi as much as possible.
	To make Vim behave a little bit better, try resetting the 'compatible'
	option:
		:set nocompatible
	Or start Vim with the "-N" argument:
		vim -N
	Vim starts with 'nocompatible' automatically if you have a .vimrc
	file.  See |startup|.
	The 'cpoptions' option can be used to set Vi compatibility on/off for
	a number of specific items.

Support for different systems.
	Vim can be used on:
	- All Unix systems (it works on all systems it was tested on, although
	  the GUI and Perl interface may not work everywhere).
	- Amiga (500, 1000, 1200, 2000, 3000, 4000, ...).
	- MS-DOS in real-mode (no additional drivers required).
	- In protected mode on Windows 3.1 and