The compatible Parameter


The compatible Parameter

The compatible parameter makes vim more compatible with vi. By default this parameter is set so that vim works like vi. If you set up a ~/.vimrc startup file (page 180), the compatible parameter is unset and vim works like vim. To get started with vim you can ignore this parameter.

Caution: Do not confuse ZZ with CONTROL-Z

When you exit from vim with ZZ, make sure that you type ZZ and not CONTROL-Z (typically the suspend key). When you press CONTROL-Z, vim disappears from your screen, almost as though you had exited from it. In fact, vim will continue running in the background with your work unsaved. Refer to "Job Control" on page 272. If you try to start editing the same file with a new vim command, vim displays a message about a swap file; refer to "File Locks" on page 157.


Setting the compatible parameter changes many aspects of how vim works. For example, when the compatible parameter is set, the Undo command (page 152) can undo only your most recent change; with the compatible parameter unset, you can call undo repeatedly to undo many changes. This chapter notes when the compatible parameter affects a command. To obtain more details on the compatible parameter, give the command :help compatible RETURN. For a complete list of how vim differs from the original vi, use :help vi-diff RETURN. See page 151 for a discussion of the help command.

From the command line use the C option to set the compatible parameter and the N option to unset it. Refer to "Setting Parameters from Within vim" on page 179 for information on how to change the compatible parameter while you are running vim.




A Practical Guide to UNIX[r] for Mac OS[r] X Users
A Practical Guide to UNIX for Mac OS X Users
ISBN: 0131863339
EAN: 2147483647
Year: 2005
Pages: 234

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net