?? version5.txt
字號(hào):
*version5.txt* For Vim version 5.8. Last change: 2001 May 31 VIM REFERENCE MANUAL by Bram MoolenaarWelcome to Vim Version 5.0!This document lists the differences between Vim 4.x and Vim 5.0.Although 5.0 is mentioned here, this is also for version 5.1, 5.2, etc..See |vi_diff.txt| for an overview of differences between Vi and Vim 5.0.See |version4.txt| for differences between Vim 3.0 and Vim 4.0.INCOMPATIBLE:Default value for 'compatible' changed |cp-default|Text formatting command "Q" changed |Q-command-changed|Command-line arguments changed |cmdline-changed|Autocommands are kept |autocmds-kept|Use of 'hidden' changed |hidden-changed|Text object commands changed |text-objects-changed|X-Windows Resources removed |x-resources|Use of $VIM |$VIM-use|Use of $HOME for MS-DOS and Win32 |$HOME-use|Tags file format changed |tags-file-changed|Options changed |options-changed|CTRL-B in Insert mode gone |i_CTRL-B-gone|NEW FEATURES:Syntax highlighting |new-highlighting|Built-in script language |new-script|Perl and Python support |new-perl-python|Win32 GUI version |added-win32-GUI|VMS version |added-VMS|BeOS version |added-BeOS|Macintosh GUI version |added-Mac|More Vi compatible |more-compatible|Read input from stdin |read-stdin|Regular expression patterns |added-regexp|Overloaded tags |tag-overloaded|New commands |new-commands|New options |added-options|New command-line arguments |added-cmdline-args|Various additions |added-various|IMPROVEMENTS |improvements|COMPILE TIME CHANGES |compile-changes|BUG FIXES |bug-fixes|VERSION 5.1 |version-5.1|Changed |changed-5.1|Added |added-5.1|Fixed |fixed-5.1|VERSION 5.2 |version-5.2|Long lines editable |long-lines|File browser added |file-browser|Dialogs added |dialogs-added|Popup menu added |popup-menu-added|Select mode added |new-Select-mode|Session files added |new-session-files|User defined functions and commands |new-user-defined|New interfaces |interfaces-5.2|New ports |ports-5.2|Multi-byte support |new-multi-byte|New functions |new-functions-5.2|New options |new-options-5.2|New Ex commands |new-ex-commands-5.2|Changed |changed-5.2|Added |added-5.2|Fixed |fixed-5.2|VERSION 5.3 |version-5.3|Changed |changed-5.3|Added |added-5.3|Fixed |fixed-5.3|VERSION 5.4 |version-5.4|Runtime directory introduced |new-runtime-dir|Filetype introduced |new-filetype-5.4|Vim script line continuation |new-line-continuation|Improved session files |improved-sessions|Autocommands improved |improved-autocmds-5.4|Encryption |new-encryption|GTK GUI port |new-GTK-GUI|Menu changes |menu-changes-5.4|Viminfo improved |improved-viminfo|Various new commands |new-commands-5.4|Various new options |new-options-5.4|Vim scripts |new-script-5.4|Avoid hit-return prompt |avoid-hit-return|Improved quickfix |improved-quickfix|Regular expressions |regexp-changes-5.4|Changed |changed-5.4|Added |added-5.4|Fixed |fixed-5.4|VERSION 5.5 |version-5.5|Changed |changed-5.5|Added |added-5.5|Fixed |fixed-5.5|VERSION 5.6 |version-5.6|Changed |changed-5.6|Added |added-5.6|Fixed |fixed-5.6|VERSION 5.7 |version-5.7|Changed |changed-5.7|Added |added-5.7|Fixed |fixed-5.7|VERSION 5.8 |version-5.8|Changed |changed-5.8|Added |added-5.8|Fixed |fixed-5.8|============================================================================== INCOMPATIBLEDefault value for 'compatible' changed *cp-default*--------------------------------------Vim version 5.0 tries to be more Vi compatible. This helps people who use Vimas a drop-in replacement for Vi, but causes some things to be incompatiblewith version 4.x.In version 4.x the default value for the 'compatible' option was off. Now thedefault is on. The first thing you will notice is that the "u" command undoesitself. Other side effects will be that mappings may work differently or notwork at all.Since a lot of people switching from Vim 4.x to 5.0 will find this annoying,the 'compatible' option is switched off if Vim finds a vimrc file. This is abit of magic to make sure that 90% of the Vim users will not be bitten bythis change.What does this mean?- If you prefer to run in 'compatible' mode and don't have a vimrc file, you don't have to do anything.- If you prefer to run in 'nocompatible' mode and do have a vimrc file, you don't have to do anything.- If you prefer to run in 'compatible' mode and do have a vimrc file, you should put this line first in your vimrc file:> :set compatible- If you prefer to run in 'nocompatible' mode and don't have a vimrc file, you can do one of the following: - Create an empty vimrc file (e.g.: "~/.vimrc" for Unix). - Put this command in your .exrc file or $EXINIT:> :set nocompatible - Start Vim with the "-N" argument.If you are new to Vi and Vim, using 'nocompatible' is strongly recommended,because Vi has a lot of unexpected side effects, which are avoided by thissetting. See 'compatible'.If you like some things from 'compatible' and some not, you can tune thecompatibility with 'cpoptions'.When you invoke Vim as "ex" or "gex", Vim always starts in compatible mode.Text formatting command "Q" changed *Q-command-changed*-----------------------------------The "Q" command formerly formatted lines to the width the 'textwidth' optionspecifies. The command for this is now "gq" (see |gq| for more info). Thereason for this change is that "Q" is the standard Vi command to enter "Ex"mode, and Vim now does in fact have an "Ex" mode (see |Q| for more info).If you still want to use "Q" for formatting, use this mapping:> :noremap Q gqAnd if you also want to use the functionality of "Q":> :noremap gQ QCommand-line arguments changed *cmdline-changed*------------------------------Command-line file-arguments and option-arguments can now be mixed. You cangive options after the file names. Example:> vim main.c -gThis is not possible when editing a file that starts with a '-'. Use the "--"argument then |---|:> vim -g -- -main.c"-v" now means to start Ex in Vi mode, use "-R" for read-only mode.old: "vim -v file" |-v|new: "vim -R file" |-R|"-e" now means to start Vi in Ex mode, use "-q" for quickfix.old: "vim -e errorfile" |-e|new: "vim -q errorfile" |-q|"-s" in Ex mode now means to run in silent (batch) mode. |-s-ex|"-x" reserved for crypt, use "-f" to avoid starting a new CLI (Amiga).old: "vim -x file" |-x|new: "vim -f file" |-f|Vim allows up to ten "+cmd" and "-c cmd" arguments. Previously Vim executedonly the last one."-n" now overrides any setting for 'updatecount' in a vimrc file, but not ina gvimrc file.Autocommands are kept *autocmds-kept*---------------------Before version 5.0, autocommands with the same event, file name pattern, andcommand could appear only once. This was fine for simple autocommands (likesetting option values), but for more complicated autocommands, where the samecommand might appear twice, this restriction caused problems. ThereforeVim stores all autocommands and keeps them in the order that they are defined.The most obvious side effect of this change is that when you source a vimrcfile twice, the autocommands in it will be defined twice. To avoid this, doone of these:- Remove any autocommands that might potentially defined twice before defining them. Example:> :au! * *.ext> :au BufEnter *.ext ...- Put the autocommands inside an ":if" command. Example:> if !exists("did_ext_autocmds")> let did_ext_autocmds = 1> autocmd BufEnter *.ext ...> endif- Put your autocommands in a different autocommand group so you can remove them before defining them |:augroup|:> augroup uncompress> au!> au BufReadPost *.gz ...> augroup ENDUse of 'hidden' changed *hidden-changed*-----------------------In version 4.x, only some commands used the 'hidden' option. Now all commandsuses it whenever a buffer disappears from a window.Previously you could do ":buf xxx" in a changed buffer and that buffer wouldthen become hidden. Now you must set the 'hidden' option for this to work.The new behavior is simpler: whether Vim hides buffers no longer depends onthe specific command that you use.- with 'hidden' not set, you never get hidden buffers. Exceptions are the ":hide" and ":close!" commands and, in rare cases, where you would otherwise lose changes to the buffer.- With 'hidden' set, you almost never unload a buffer. Exceptions are the ":bunload" or ":bdel" commands.":buffer" now supports a "!": abandon changes in current buffer. So do":bnext", ":brewind", etc.Text object commands changed *text-objects-changed*----------------------------Text object commands have new names. This allows more text objects and makescharacters available for other Visual mode commands. Since no more singlecharacters were available, text objects names now require two characters.The first one is always 'i' or 'a'. OLD NEW ~ a aw a word |v_aw| A aW a WORD |v_aW| s as a sentence |v_as| p ap a paragraph |v_ap| S ab a () block |v_ab| P aB a {} block |v_aB|There is another set of text objects that starts with "i", for "inner". Theseselect the same objects, but exclude white space.X-Windows Resources removed *x-resources*--------------------------Vim no longer supports the following X resources:- boldColor- italicColor- underlineColor- cursorColorVim now uses highlight groups to set colors. This avoids the confusion ofusing a bold Font, which would imply a certain color. See |:highlight| and|gui-resources|.Use of $VIM *$VIM-use*-----------Vim now uses the VIM environment variable to find all Vim system files. Thisincludes the global vimrc, gvimrc, and menu.vim files and all on-line helpand syntax files. See |$VIM|. Starting with version 5.4, |$VIMRUNTIME| canalso be used.For Unix, Vim sets a default value for $VIM when doing "make install".When $VIM is not set, its default value is the directory from 'helpfile',excluding "/doc/help.txt".Use of $HOME for MS-DOS and Win32 *$HOME-use*---------------------------------The MS-DOS and Win32 versions of Vim now first check $HOME when searching fora vimrc or exrc file and for reading/storing the viminfo file. Previously Vimused $VIM for these systems, but this causes trouble on a system with severalusers. Now Vim uses $VIM only when $HOME is not set or the file is not foundin $HOME. See |_vimrc|.Tags file format changed *tags-file-changed*------------------------Only Tabs are allowed to separate fields in a tags file. This allows forspaces in a file name and is still Vi compatible. In previous versions ofVim, any white space was allowed to separate the fields. If you have a filewhich doesn't use a single Tab between fields, edit the tags file and executethis command:> :%s/\(\S*\)\s\+\(\S*\)\s\+\(.*\)/\1\t\2\t\3/Options changed *options-changed*---------------The default value of 'errorfile' has changed from "errors.vim" to "errors.err".The reason is that only Vim scripts should have the ".vim" extensions.The ":make" command no longer uses the 'errorfile' option. This prevents theoutput of the ":make" command from overwriting a manually saved error file.":make" uses the 'makeef' option instead. This also allows for generating aunique name, to prevent concurrently running ":make" commands from overwritingeach other's files.With 'insertmode' set, a few more things change:- <Esc> in Normal mode goes to Insert mode.- <Esc> in Insert mode doesn't leave Insert mode.- When doing ":set im", go to Insert mode immediately.Vim considers a buffer to be changed when the 'fileformat' (formerly the'textmode' option) is different from the buffer's initial format.CTRL-B in Insert mode gone *i_CTRL-B-gone*--------------------------
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -