|
发表于 2004-9-11 11:56:09
|
显示全部楼层
[code:1]*Q_co* 复杂改动
|!| N !{motion}{command}<CR>
将动作覆盖的行用命令 {command} 过滤
|!!| N !!{command}<CR>
用命令 {command} 过滤 N 行
|v_!| {visual}!{command}<CR>
将加亮的行用命令 {command} 过滤
|:range!| :[range]! {command}<CR>
将范围 [range] 包括的行用命令 {command} 过滤
|=| N ={motion}
将动作覆盖的行用 'equalprg' 过滤
|==| N == 用 'equalprg' 过滤 N 行
|v_=| {visual}=
将加亮的行用 'equalprg' 过滤
|:s| :[range]s[ubstitute]/{pattern}/{string}/[g][c]
以 {string} 替换范围 [range] 包括的行中的 {pattern} ;
与 [g] 共用, 替换所有的出现的 {pattern};
与 [c] 公用, 确认每一次替换
|:s| :[range]s[ubstitute] [g][c]
以新的范围和选项重复上一次的 ":s" 命令
|&| & 不带选项在当前行上重复上一次的 ":s" 命令
|:ret| :[range]ret[ab][!] [tabstop]
置 'tabstop' 为新值并依据此值调整空白字符
------------------------------------------------------------------------------
*Q_vi* 可视模式
|visual-index| 可视模式命令列表
|v| v 开始加亮字符 } 移动光标或使用
|V| V 开始以行方式加亮文本 } 操作符来影响被
|CTRL-V| CTRL-V 开始以块方式加亮文本 } 加亮的文本
|v_o| o 与高亮区域的开始交换光标位置
|gv| gv 以上一次的可视区域开始加亮文本
|v_v| v 开始以字符方式加亮或停止加亮
|v_V| V 开始以行方式加亮或停止加亮
|v_CTRL-V| CTRL-V 开始以块方式加亮或停止加亮
------------------------------------------------------------------------------
*Q_to* 文本对象 (仅适用于可视模式或在操作符后)
|v_aw| N aw 选择 "一个单词"
|v_iw| N iw 选择 "内单词"
|v_aW| N aW 选择 "一个 |WORD|"
|v_iW| N iW 选择 "内 |WORD|"
|v_as| N as 选择 "一个句子"
|v_is| N is 选择 "内句子"
|v_ap| N ap 选择 "选择一个段落"
|v_ip| N ip 选择 "内段落"
|v_ab| N ab 选择 "一个块" (从 "[(" 至 "])")
|v_ib| N ib 选择 "内块" (从 "[(" 到 "])")
|v_aB| N aB 选择 "一个 Block" (从 "[{" 到 "]}")
|v_iB| N iB 选择 "内 Block" (从 "[{" 到 "]}")
------------------------------------------------------------------------------
*Q_re* 重复命令
|.| N . 重复最近一次改动 (将次数改为 N)
|q| q{a-z} 将键入的字符录入寄存器 {a-z}
|q| q{A-Z} 将键入的字符添加进寄存器 {a-z}
|q| q 终止纪录
|@| N @{a-z} 执行寄存器 {a-z} 的内容(N 次)
|@@| N @@ 重复上次的 @{a-z} 操作 (N 次)
|:@| :@{a-z} 将寄存器 {a-z} 的内容当作一个 Ex
命令来执行
|:@@| :@@ 重复上次的 :@{a-z} 操作
|:g| :[range]g[lobal]/{pattern}/[cmd]
对 [range] 内所有匹配 {pattern} 的行执行 Ex 命令 [cmd]
(缺省: ":p")
|:g| :[range]g[lobal]!/{pattern}/[cmd]
对 [range] 内所有不匹配 {pattern} 的行执行 Ex 命令 [cmd]
(缺省: ":p")
|:so| :so[urce] {file}
从文件 {file} 读入 Ex 命令
|:so| :so[urce]! {file}
从文件 {file} 读入 Vim 命令
|:sl| :sl[eep] [sec]
在 [sec] 秒钟内任何事也不做
|gs| N gs 睡 N 秒
------------------------------------------------------------------------------
*Q_km* 键盘映射
|:map| :ma[p] {lhs} {rhs} 在普通及可视模式下将 {rhs} 映射为 {lhs}
|:map!| :ma[p]! {lhs} {rhs} 在插入及命令行模式下将 {rhs} 映射为 {lhs}
|:noremap| :no[remap][!] {lhs} {rhs}
如 ":map", 但不能为 {rhs} 做重映射
|:unmap| :unm[ap] {lhs} 清除普通及可视模式下 {lhs} 的映射
|:unmap!| :unm[ap]! {lhs} 清除插入及命令行模式下 {lhs} 的映射
|:map_l| :ma[p] [lhs] 列出普通及可视模式下以 [lhs] 开始的映射.
|:map_l!| :ma[p]! [lhs] 列出插入及命令行模式下以 [lhs] 开始的映射.
|:cmap| :cmap/:cunmap/:cnoremap
如 ":map!"/":unmap!"/":noremap!" 但仅作用于
命令行模式
|:imap| :imap/:iunmap/:inoremap
如 ":map!"/":unmap!"/":noremap!" 但仅作用于
插入行模式
|:nmap| :nmap/:nunmap/:nnoremap
如 ":map!"/":unmap!"/":noremap!" 但仅作用于
普通行模式
|:vmap| :vmap/:vunmap/:vnoremap
如 ":map!"/":unmap!"/":noremap!" 但仅作用于
可视模式
|:omap| :omap/:ounmap/:onoremap
如 ":map!"/":unmap!"/":noremap!" 但仅作用于
Operator-pending 模式
|:mapc| :mapc[lear] 清除通及可视模式下的映射
|:mapc| :mapc[lear]! 清除插入及命令行模式下的映射
|:imapc| :imapc[lear] 清除插入模式下的映射
|:vmapc| :vmapc[lear] 清除可视模式下的映射
|:omapc| :omapc[lear] 清除 Operator-pending 模式下的映射
|:nmapc| :nmapc[lear] 清除普通模式下的映射
|:cmapc| :cmapc[lear] 清除命令行模式下的映射
|:mkexrc| :mk[exrc][!] [file] 将当前的键盘映射, 缩写, 及设置
写入文件 [file] (缺省: ".exrc";
使用 ! 覆盖文件)
|:mkvimrc| :mkv[imrc][!] [file]
如 ":mkexrc", 但缺省为 ".vimrc"
|:mksession| :mks[ession][!] [file]
如 ":mkvimrc", 但同时存储当前文件, 窗口
等等信息, 使得用户将来可以继续当前对话.
------------------------------------------------------------------------------
*Q_ab* 缩写
|:abbreviate| :ab[breviate] {lhs} {rhs} 为 {rhs} 加入缩写 {lhs}
|:abbreviate| :ab[breviate] {lhs} 显示 {lhs} 以开始的缩写
|:abbreviate| :ab[breviate] 显示所有缩写
|:unabbreviate| :una[bbreviate] {lhs} 删除所有 {lhs} 代表的缩写
|:noreabbrev| :norea[bbrev] [lhs] [rhs] 同 ":ab", but don't remap [rhs]
|:iabbrev| :iab/:iunab/:inoreab 同 ":ab", 但仅适用于插入模式
|:cabbrev| :cab/:cunab/:cnoreab 同 ":ab", 但仅适用于命令行模式
|:abclear| :abc[lear] 清除所有缩写
|:cabclear| :cabc[lear] 清除所有命令行模式缩写
|:iabclear| :iabc[lear] 清除所有插入模式缩写
------------------------------------------------------------------------------
*Q_op* 选项
|:set| :se[t] 显示所有被改动的选项
|:set| :se[t] all 显示所有非 termcap 选项
|:set| :se[t] termcap 显示所有 termcap 选项
|:set| :se[t] {option} 置布尔选项 (开启),
显示字符穿或数字选项.
|:set| :se[t] no{option} 复位布尔选项 (关闭).
|:set| :se[t] inv{option} invert boolean option.
|:set| :se[t] {option}={value} Set string/number option to {value}.
|:set| :se[t] {option}+={value} append {value} to string option, add
{value} to number option
|:set| :se[t] {option}-={value} remove {value} to string option,
subtract {value} from number option
|:set| :se[t] {option}? 显示 {option} 的值
|:set| :se[t] {option}& Reset {option} to its default value.
|:setlocal| :setl[ocal] like ":set" but set the local value
for options that have one
|:setglobal| :setg[lobal] like ":set" but set the global value
of a local option
|:fix| :fix[del] Set value of 't_kD' according to
value of 't_kb'.
|:options| :opt[ions] Open a new window to view and set
options, grouped by functionality,
a one line explanation and links to
the help.
各选项的简短说明: *option-list*
|'aleph'| |'al'| ASCII code of the letter Aleph (Hebrew)
|'allowrevins'| |'ari'| allow CTRL-_ in Insert and Command-line mode
|'altkeymap'| |'akm'| for default second language (Farsi/Hebrew)
|'ambiwidth'| |'ambw'| what to do with Unicode chars of ambiguous width
|'antialias'| |'anti'| Mac OS X: use smooth, antialiased fonts
|'autochdir'| |'acd'| change directory to the file in the current window
|'arabic'| |'arab'| for Arabic as a default second language
|'arabicshape'| |'arshape'| do shaping for Arabic characters
|'autoindent'| |'ai'| take indent for new line from previous line
|'autoread'| |'ar'| autom. read file when changed outside of Vim
|'autowrite'| |'aw'| automatically write file if changed
|'autowriteall'| |'awa'| as 'autowrite', but works with more commands
|'background'| |'bg'| "dark" or "light", used for highlight colors
|'backspace'| |'bs'| how backspace works at start of line
|'backup'| |'bk'| keep backup file after overwriting a file
|'backupcopy'| |'bkc'| make backup as a copy, don't rename the file
|'backupdir'| |'bdir'| list of directories for the backup file
|'backupext'| |'bex'| extension used for the backup file
|'backupskip'| |'bsk'| no backup for files that match these patterns
|'balloondelay'| |'bdlay'| delay in mS before a balloon may pop up
|'ballooneval'| |'beval'| switch on balloon evaluation
|'binary'| |'bin'| read/write/edit file in binary mode
|'bioskey'| |'biosk'| MS-DOS: use bios calls for input characters
|'bomb'| prepend a Byte Order Mark to the file
|'breakat'| |'brk'| characters that may cause a line break
|'browsedir'| |'bsdir'| which directory to start browsing in
|'bufhidden'| |'bh'| what to do when buffer is no longer in window
|'buflisted'| |'bl'| whether the buffer shows up in the buffer list
|'buftype'| |'bt'| special type of buffer
|'casemap'| |'cmp'| specifies how case of letters is changed
|'cdpath'| |'cd'| list of directories searched with ":cd"
|'cedit'| key used to open the command-line window
|'charconvert'| |'ccv'| expression for character encoding conversion
|'cindent'| |'cin'| do C program indenting
|'cinkeys'| |'cink'| keys that trigger indent when 'cindent' is set
|'cinoptions'| |'cino'| how to do indenting when 'cindent' is set
|'cinwords'| |'cinw'| words where 'si' and 'cin' add an indent
|'clipboard'| |'cb'| use the clipboard as the unnamed register
|'cmdheight'| |'ch'| number of lines to use for the command-line
|'cmdwinheight'| |'cwh'| height of the command-line window
|'columns'| |'co'| number of columns in the display
|'comments'| |'com'| patterns that can start a comment line
|'commentstring'| |'cms'| template for comments; used for fold marker
|'compatible'| |'cp'| behave Vi-compatible as much as possible
|'complete'| |'cpt'| specify how Insert mode completion works
|'confirm'| |'cf'| ask what to do about unsaved/read-only files
|'conskey'| |'consk'| get keys directly from console (MS-DOS only)
|'copyindent'| |'ci'| make 'autoindent' use existing indent structure
|'cpoptions'| |'cpo'| flags for Vi-compatible behavior
|'cscopepathcomp'| |'cspc'| how many components of the path to show
|'cscopeprg'| |'csprg'| command to execute cscope
|'cscopequickfix'| |'csqf'| use quickfix window for cscope results
|'cscopetag'| |'cst'| use cscope for tag commands
|'cscopetagorder'| |'csto'| determines ":cstag" search order
|'cscopeverbose'| |'csverb'| give messages when adding a cscope database
|'debug'| set to "msg" to see all error messages
|'define'| |'def'| pattern to be used to find a macro definition
|'delcombine'| |'deco'| delete combining characters on their own
|'dictionary'| |'dict'| list of file names used for keyword completion
|'diff'| use diff mode for the current window
|'diffexpr'| |'dex'| expression used to obtain a diff file
|'diffopt'| |'dip'| options for using diff mode
|'digraph'| |'dg'| enable the entering of digraphs in Insert mode
|'directory'| |'dir'| list of directory names for the swap file
|'display'| |'dy'| list of flags for how to display text
|'eadirection'| |'ead'| in which direction 'equalalways' works
|'edcompatible'| |'ed'| toggle flags of ":substitute" command
|'encoding'| |'enc'| encoding used internally
|'endofline'| |'eol'| write <EOL> for last line in file
|'equalalways'| |'ea'| windows are automatically made the same size
|'equalprg'| |'ep'| external program to use for "=" command
|'errorbells'| |'eb'| ring the bell for error messages
|'errorfile'| |'ef'| name of the errorfile for the QuickFix mode
|'errorformat'| |'efm'| description of the lines in the error file
|'esckeys'| |'ek'| recognize function keys in Insert mode
|'eventignore'| |'ei'| autocommand events that are ignored
|'expandtab'| |'et'| use spaces when <Tab> is inserted
|'exrc'| |'ex'| read .vimrc and .exrc in the current directory
|'fileencoding'| |'fenc'| file encoding for multi-byte text
|'fileencodings'| |'fencs'| automatically detected character encodings
|'fileformat'| |'ff'| file format used for file I/O
|'fileformats'| |'ffs'| automatically detected values for 'fileformat'
|'filetype'| |'ft'| type of file, used for autocommands
|'fillchars'| |'fcs'| characters to use for displaying special items
|'fkmap'| |'fk'| Farsi keyboard mapping
|'foldclose'| |'fcl'| close a fold when the cursor leaves it
|'foldcolumn'| |'fdc'| width of the column used to indicate folds
|'foldenable'| |'fen'| set to display all folds open
|'foldexpr'| |'fde'| expression used when 'foldmethod' is "expr"
|'foldignore'| |'fdi'| ignore lines when 'foldmethod' is "indent"
|'foldlevel'| |'fdl'| close folds with a level higher than this
|'foldlevelstart'| |'fdls'| 'foldlevel' when starting to edit a file
|'foldmarker'| |'fmr'| markers used when 'foldmethod' is "marker"
|'foldmethod'| |'fdm'| folding type
|'foldminlines'| |'fml'| minimum number of lines for a fold to be closed
|'foldnestmax'| |'fdn'| maximum fold depth
|'foldopen'| |'fdo'| for which commands a fold will be opened
|'foldtext'| |'fdt'| expression used to display for a closed fold
|'formatoptions'| |'fo'| how automatic formatting is to be done
|'formatprg'| |'fp'| name of external program used with "gq" command
|'gdefault'| |'gd'| the ":substitute" flag 'g' is default on
|'grepformat'| |'gfm'| format of 'grepprg' output
|'grepprg'| |'gp'| program to use for ":grep"
|'guicursor'| |'gcr'| GUI: settings for cursor shape and blinking
|'guifont'| |'gfn'| GUI: Name(s) of font(s) to be used
|'guifontset'| |'gfs'| GUI: Names of multi-byte fonts to be used
|'guifontwide'| |'gfw'| list of font names for double-wide characters
|'guiheadroom'| |'ghr'| GUI: pixels room for window decorations
|'guioptions'| |'go'| GUI: Which components and options are used
|'guipty'| GUI: try to use a pseudo-tty for ":!" commands
|'helpfile'| |'hf'| full path name of the main help file
|'helpheight'| |'hh'| minimum height of a new help window
|'helplang'| |'hlg'| preferred help languages
|'hidden'| |'hid'| don't unload buffer when it is |abandon|ed
|'highlight'| |'hl'| sets highlighting mode for various occasions
|'hlsearch'| |'hls'| highlight matches with last search pattern
|'history'| |'hi'| number of command-lines that are remembered
|'hkmap'| |'hk'| Hebrew keyboard mapping
|'hkmapp'| |'hkp'| phonetic Hebrew keyboard mapping
|'icon'| let Vim set the text of the window icon
|'iconstring'| string to use for the Vim icon text
|'ignorecase'| |'ic'| ignore case in search patterns
|'imactivatekey'| |'imak'| key that activates the X input method
|'imcmdline'| |'imc'| use IM when starting to edit a command line
|'imdisable'| |'imd'| do not use the IM in any mode
|'iminsert'| |'imi'| use :lmap or IM in Insert mode
|'imsearch'| |'ims'| use :lmap or IM when typing a search pattern
|'include'| |'inc'| pattern to be used to find an include file
|'includeexpr'| |'inex'| expression used to process an include line
|'incsearch'| |'is'| highlight match while typing search pattern
|'indentexpr'| |'inde'| expression used to obtain the indent of a line
|'indentkeys'| |'indk'| keys that trigger indenting with 'indentexpr'
|'infercase'| |'inf'| adjust case of match for keyword completion
|'insertmode'| |'im'| start the edit of a file in Insert mode
|'isfname'| |'isf'| characters included in file names and pathnames
|'isident'| |'isi'| characters included in identifiers
|'iskeyword'| |'isk'| characters included in keywords
|'isprint'| |'isp'| printable characters
|'joinspaces'| |'js'| two spaces after a period with a join command
|'key'| encryption key
|'keymap'| |'kmp'| name of a keyboard mapping
|'keymodel'| |'km'| enable starting/stopping selection with keys
|'keywordprg'| |'kp'| program to use for the "K" command
|'langmap'| |'lmap'| alphabetic characters for other language mode
|'langmenu'| |'lm'| language to be used for the menus
|'laststatus'| |'ls'| tells when last window has status lines
|'lazyredraw'| |'lz'| don't redraw while executing macros
|'linebreak'| |'lbr'| wrap long lines at a blank
|'lines'| number of lines in the display
|'linespace'| |'lsp'| number of pixel lines to use between characters
|'lisp'| automatic indenting for Lisp
|'lispwords'| |'lw'| words that change how lisp indenting works
|'list'| show <Tab> and <EOL>
|'listchars'| |'lcs'| characters for displaying in list mode
|'loadplugins'| |'lpl'| load plugin scripts when starting up
|'magic'| changes special characters in search patterns
|'makeef'| |'mef'| name of the errorfile for ":make"
|'makeprg'| |'mp'| program to use for the ":make" command
|'matchpairs'| |'mps'| pairs of characters that "%" can match
|'matchtime'| |'mat'| tenths of a second to show matching paren
|'maxfuncdepth'| |'mfd'| maximum recursive depth for user functions
|'maxmapdepth'| |'mmd'| maximum recursive depth for mapping
|'maxmem'| |'mm'| maximum memory (in Kbyte) used for one buffer
|'maxmemtot'| |'mmt'| maximum memory (in Kbyte) used for all buffers
|'menuitems'| |'mis'| maximum number of items in a menu
|'modeline'| |'ml'| recognize modelines at start or end of file
|'modelines'| |'mls'| number of lines checked for modelines
|'modifiable'| |'ma'| changes to the text are not possible
|'modified'| |'mod'| buffer has been modified
|'more'| pause listings when the whole screen is filled
|'mouse'| enable the use of mouse clicks
|'mousefocus'| |'mousef'| keyboard focus follows the mouse
|'mousehide'| |'mh'| hide mouse pointer while typing
|'mousemodel'| |'mousem'| changes meaning of mouse buttons
|'mouseshape'| |'mouses'| shape of the mouse pointer in different modes
|'mousetime'| |'mouset'| max time between mouse double-click
|'nrformats'| |'nf'| number formats recognized for CTRL-A command
|'number'| |'nu'| print the line number in front of each line
|'osfiletype'| |'oft'| operating system-specific filetype information
|'paragraphs'| |'para'| nroff macros that separate paragraphs
|'paste'| allow pasting text
|'pastetoggle'| |'pt'| key code that causes 'paste' to toggle
|'patchexpr'| |'pex'| expression used to patch a file
|'patchmode'| |'pm'| keep the oldest version of a file
|'path'| |'pa'| list of directories searched with "gf" et.al.
|'preserveindent'| |'pi'| preserve the indent structure when reindenting
|'previewheight'| |'pvh'| height of the preview window
|'previewwindow'| |'pvw'| identifies the preview window
|'printdevice'| |'pdev'| name of the printer to be used for :hardcopy
|'printencoding'| |'penc'| encoding to be used for printing
|'printexpr'| |'pexpr'| expression used to print PostScript for :hardcopy
|'printfont'| |'pfn'| name of the font to be used for :hardcopy
|'printheader'| |'pheader'| format of the header used for :hardcopy
|'printoptions'| |'popt'| controls the format of :hardcopy output
|'readonly'| |'ro'| disallow writing the buffer
|'remap'| allow mappings to work recursively
|'report'| threshold for reporting nr. of lines changed
|'restorescreen'| |'rs'| Win32: restore screen when exiting
|'revins'| |'ri'| inserting characters will work backwards
|'rightleft'| |'rl'| window is right-to-left oriented
|'rightleftcmd'| |'rlc'| commands for which editing works right-to-left
|'ruler'| |'ru'| show cursor line and column in the status line
|'rulerformat'| |'ruf'| custom format for the ruler
|'runtimepath'| |'rtp'| list of directories used for runtime files
|'scroll'| |'scr'| lines to scroll with CTRL-U and CTRL-D
|'scrollbind'| |'scb'| scroll in window as other windows scroll
|'scrolljump'| |'sj'| minimum number of lines to scroll
|'scrolloff'| |'so'| minimum nr. of lines above and below cursor
|'scrollopt'| |'sbo'| how 'scrollbind' should behave
|'sections'| |'sect'| nroff macros that separate sections
|'secure'| secure mode for reading .vimrc in current dir
|'selection'| |'sel'| what type of selection to use
|'selectmode'| |'slm'| when to use Select mode instead of Visual mode
|'sessionoptions'| |'ssop'| options for |:mksession|
|'shell'| |'sh'| name of shell to use for external commands
|'shellcmdflag'| |'shcf'| flag to shell to execute one command
|'shellpipe'| |'sp'| string to put output of ":make" in error file
|'shellquote'| |'shq'| quote character(s) for around shell command
|'shellredir'| |'srr'| string to put output of filter in a temp file
|'shellslash'| |'ssl'| use forward slash for shell file names
|'shelltype'| |'st'| Amiga: influences how to use a shell
|'shellxquote'| |'sxq'| like 'shellquote', but include redirection
|'shiftround'| |'sr'| round indent to multiple of shiftwidth
|'shiftwidth'| |'sw'| number of spaces to use for (auto)indent step
|'shortmess'| |'shm'| list of flags, reduce length of messages
|'shortname'| |'sn'| non-MS-DOS: Filenames assumed to be 8.3 chars
|'showbreak'| |'sbr'| string to use at the start of wrapped lines
|'showcmd'| |'sc'| show (partial) command in status line
|'showfulltag'| |'sft'| show full tag pattern when completing tag
|'showmatch'| |'sm'| briefly jump to matching bracket if insert one
|'showmode'| |'smd'| message on status line to show current mode
|'sidescroll'| |'ss'| minimum number of columns to scroll horizontal
|'sidescrolloff'| |'siso'| min. nr. of columns to left and right of cursor
|'smartcase'| |'scs'| no ignore case when pattern has uppercase
|'smartindent'| |'si'| smart autoindenting for C programs
|'smarttab'| |'sta'| use 'shiftwidth' when inserting <Tab>
|'softtabstop'| |'sts'| number of spaces that <Tab> uses while editing
|'splitbelow'| |'sb'| new window from split is below the current one
|'splitright'| |'spr'| new window is put right of the current one
|'startofline'| |'sol'| commands move cursor to first blank in line
|'statusline'| |'stl'| custom format for the status line
|'suffixes'| |'su'| suffixes that are ignored with multiple match
|'suffixesadd'| |'sua'| suffixes added when searching for a file
|'swapfile'| |'swf'| whether to use a swapfile for a buffer
|'swapsync'| |'sws'| how to sync the swap file
|'switchbuf'| |'swb'| sets behavior when switching to another buffer
|'syntax'| |'syn'| syntax to be loaded for current buffer
|'tabstop'| |'ts'| number of spaces that <Tab> in file uses
|'tagbsearch'| |'tbs'| use binary searching in tags files
|'taglength'| |'tl'| number of significant characters for a tag
|'tagrelative'| |'tr'| file names in tag file are relative
|'tags'| |'tag'| list of file names used by the tag command
|'tagstack'| |'tgst'| push tags onto the tag stack
|'term'| name of the terminal
|'termbidi'| |'tbidi'| terminal takes care of bi-directionality
|'termencoding'| |'tenc'| character encoding used by the terminal
|'terse'| shorten some messages
|'textauto'| |'ta'| obsolete, use 'fileformats'
|'textmode'| |'tx'| obsolete, use 'fileformat'
|'textwidth'| |'tw'| maximum width of text that is being inserted
|'thesaurus'| |'tsr'| list of thesaurus files for keyword completion
|'tildeop'| |'top'| tilde command "~" behaves like an operator
|'timeout'| |'to'| time out on mappings and key codes
|'timeoutlen'| |'tm'| time out time in milliseconds
|'title'| let Vim set the title of the window
|'titlelen'| percentage of 'columns' used for window title
|'titleold'| old title, restored when exiting
|'titlestring'| string to use for the Vim window title
|'toolbar'| |'tb'| GUI: which items to show in the toolbar
|'toolbariconsize'| |'tbis'| size of the toolbar icons (for GTK 2 only)
|'ttimeout'| time out on mappings
|'ttimeoutlen'| |'ttm'| time out time for key codes in milliseconds
|'ttybuiltin'| |'tbi'| use built-in termcap before external termcap
|'ttyfast'| |'tf'| indicates a fast terminal connection
|'ttymouse'| |'ttym'| type of mouse codes generated
|'ttyscroll'| |'tsl'| maximum number of lines for a scroll
|'ttytype'| |'tty'| alias for 'term'
|'undolevels'| |'ul'| maximum number of changes that can be undone
|'updatecount'| |'uc'| after this many characters flush swap file
|'updatetime'| |'ut'| after this many milliseconds flush swap file
|'verbose'| |'vbs'| give informative messages
|'viewdir'| |'vdir'| directory where to store files with :mkview
|'viewoptions'| |'vop'| specifies what to save for :mkview
|'viminfo'| |'vi'| use .viminfo file upon startup and exiting
|'virtualedit'| |'ve'| when to use virtual editing
|'visualbell'| |'vb'| use visual bell instead of beeping
|'warn'| warn for shell command when buffer was changed
|'weirdinvert'| |'wi'| for terminals that have weird inversion method
|'whichwrap'| |'ww'| allow specified keys to cross line boundaries
|'wildchar'| |'wc'| command-line character for wildcard expansion
|'wildcharm'| |'wcm'| like 'wildchar' but also works when mapped
|'wildignore'| |'wig'| files matching these patterns are not completed
|'wildmenu'| |'wmnu'| use menu for command line completion
|'wildmode'| |'wim'| mode for 'wildchar' command-line expansion
|'winaltkeys'| |'wak'| when the windows system handles ALT keys
|'winheight'| |'wh'| minimum number of lines for the current window
|'winfixheight'| |'wfh'| keep window height when opening/closing windows
|'winminheight'| |'wmh'| minimum number of lines for any window
|'winminwidth'| |'wmw'| minimal number of columns for any window
|'winwidth'| |'wiw'| minimal number of columns for current window
|'wrap'| long lines wrap and continue on the next line
|'wrapmargin'| |'wm'| chars from the right where wrapping starts
|'wrapscan'| |'ws'| searches wrap around the end of the file
|'write'| writing to a file is allowed
|'writeany'| |'wa'| write to file with no need for "!" override
|'writebackup'| |'wb'| make a backup before overwriting a file
|'writedelay'| |'wd'| delay this many msec for each char (for debug)
------------------------------------------------------------------------------
*Q_ur* 撤销/重复 命令
|u| N u 撤销最近的 N 此改动
|CTRL-R| N CTRL-R 重复最近的 N 个被撤销的改动
|U| U 恢复最近被改动的行
------------------------------------------------------------------------------
*Q_et* 外部命令
|:shell| :sh[ell] 开启一个 shell
|:!| :!{command} 通过一个 shell 执行命令 {command}
|K| K 以 'keywordprg' 程序 (缺省: "man")查光标下的关键字
------------------------------------------------------------------------------
*Q_qf* Quickfix commands
|:cc| :cc [nr] 显示错误 [nr] (缺省为同一错误)
|:cnext| :cn 显示下一个错误
|:cprevious| :cp 显示上一个错误
|:clist| :cl 列出所有错误
|:cfile| :cf 从文件 'errorfile' 读入错误
|:cquit| :cq 退出不保存并返回错误代码 (至编译器)
|:make| :make [args] 启动 make, 读入错误, 并跳转至第一个错误
|:grep| :gr[ep] [args] 执行 'grepprg' 程序以找出匹配并跳转至
第一个匹配
------------------------------------------------------------------------------
*Q_vc* 其他移动
|CTRL-L| CTRL-L 清除并重画屏幕
|CTRL-G| CTRL-G 先是当前文件名 (包括路径) 和光标位置
|ga| ga 以十进制,十六进制和八进制显示当前光标下的字符
的ASCII值
|g_CTRL-G| g CTRL-G 先是当前光标的列,行,以及字符位置
|CTRL-C| CTRL-C 在查找中: 中断查找
|dos-CTRL-Break| CTRL-Break MS-DOS: 在查找中: 中断查找
|<Del>| <Del> 当输入一个次数时: 删除前一个输入字符
|:version| :ve[rsion] 显示版本信息
|:mode| :mode N MS-DOS: 至屏幕模式为 N (数字, C80,
C4350, 等.)
|:normal| :norm[al][!] {commands}
执行普通模式命令
|Q| Q 切换至 "Ex" 模式
|:redir| :redir >{file} 重定向信息至文件 {file}
|:silent| :silent[!] {command} 沉默的执行 {command} 命令
|:confirm| :confirm {command} 退出, 写入, 等., 询问关于为保存的改动
或者只读文件.
|:browse| :browse {command} 打开/读入/写入 文件, 使用一个
文件选择对话框
------------------------------------------------------------------------------
*Q_ce* 命令行编辑
|c_<Esc>| <Esc> 放弃命令行 (如果 'wildchar' 通配符是
<Esc>, 键入两次)
|c_CTRL-V| CTRL-V {char} 按字面插入 {char}
|c_CTRL-V| CTRL-V {number} 输入10进制数表示的字符 (可达3个数位)
|c_CTRL-K| CTRL-K {char1} {char2}
键入二合字母 (参见 |Q_di|)
|c_CTRL-R| CTRL-R {0-9a-z"%#:-=}
插入指定寄存器的内容
|c_<Left>| <Left>/<Right> 光标左移/右移
|c_<S-Left>| <S-Left>/<S-Right> 光标左移/右移一个单词
|c_CTRL-B| CTRL-B/CTRL-E 光标移动至命令行行首/行尾
|c_<BS>| <BS> 删除光标前的字符
|c_<Del>| <Del> 删除光标下的字符
|c_CTRL-W| CTRL-W 删除光标前的单词
|c_CTRL-U| CTRL-U 删除所有字符
|c_<Up>| <Up>/<Down> 回忆以当前命令行开始的较早/较晚的命令
|c_<S-Up>| <S-Up>/<S-Down> 从命令行历史中回忆较早/较晚的命令
|:history| :his[tory] 显示命令行历史
上下文关联的命令行补全:
|c_wildchar| 'wildchar' (缺省: <Tab>)
根据光标前的命令行补全。如果有多个匹配,响铃
并显示第一个;继续 'wildchar' 将显示下一个
匹配。
|c_CTRL-D| CTRL-D 列出当前命令行所有可能的匹配
|c_CTRL-A| CTRL-A 插入当前命令行所有可能的匹配
|c_CTRL-L| CTRL-L 插入所有匹配当前模式的名字的最长的共同部分
|c_CTRL-N| CTRL-N 在 'wildchar' 之后存在多个匹配: 至下一匹配
|c_CTRL-P| CTRL-P 在 'wildchar' 之后存在多个匹配: 至上一匹配
------------------------------------------------------------------------------
*Q_ra* Ex 范围
|:range| , 分割两个行号
|:range| ; 同上, 但在解释第二个行号之前先至
光标与第一个行号代表的行
|:range| {number} 一个绝对行号
|:range| . 当前行
|:range| $ 本文件的最后一行
|:range| % 等同于 1,$ (整个文件)
|:range| * 等同于 '<,'> (可视区域)
|:range| 't 标记 t 的位置
|:range| /{pattern}[/] 下一个匹配 {pattern} 的行
|:range| ?{pattern}[?] 前一个匹配 {pattern} 的行
|:range| +[num] 在前面的行号上加 [num] (缺省: 1)
|:range| -[num] 从前面的行号里减 [num] (缺省: 1)
------------------------------------------------------------------------------
*Q_ex* 特殊 Ex 字符
|:bar| | 分割两个命令 (不适用于 ":global" 及 ":!")
|:quote| " 开始注释
|:_%| % 当前文件名 (仅当期望文件名时)
|:_#| #[num] alternate file 文件名 [num] (仅当期望文件名时)
注: 一下四项以字面意思键入; 并非特殊键!
|:<cword>| <cword> 光标下的 word (仅当期望文件名时)
|:<cWORD>| <cWORD> 光标下的 WORD (仅当期望文件名时)
|:<cfile>| <cfile> 光标下的文件名 (仅当期望文件名时)
|:<afile>| <afile> 供自动命令使用的文件名 (仅当期望文件名时)
|:<sfile>| <sfile> 一个被 ":source" 的文件的文件名, within that file (only
(仅当期望文件名时)
于 "%", "#", "<cfile>", "<sfile>" 或 "<afile>" 之后
|::p| :p 完整路径
|::h| :h 头 (除去文件名)
|::t| :t 尾 (仅使用文件名)
|::r| :r 根 (除去扩展名)
|::e| :e 扩展名
|::s| :s/{pat}/{repl}/ 以 {repl} 替换 {pat}
------------------------------------------------------------------------------
*Q_ed* 编辑一个文件
无 !: 若当前缓冲已被改动则失败
有 !: 放弃任何对当前缓冲的改动
|:edit_f| :e[dit][!] {file} 编辑 {file}.
|:edit| :e[dit][!] 重新载入当前文件
|:enew| :ene[w][!] 编辑一个无名的新缓冲
|:find| :fin[d][!] {file} 在 'path' 当中查找文件 {file} 并编辑之
|CTRL-^| N CTRL-^ 编辑 alternate file N (同 ":e #N").
|gf| gf or ]f 编辑光标下的文件名对应的文件
|:pwd| :pwd 显示当前目录名
|:cd| :cd [path] 将当前目录名变至 [path].
|:cd-| :cd - 回到上一次当前目录
|:file| :f[ile] 先是当前文件名及光标位置
|:file| :f[ile] {name} 至当前文件名为 {name}.
|:files| :files 显示 alternate file 的文件名.
------------------------------------------------------------------------------
*Q_fl* 使用参数列表 |argument-list|
|:args| :ar[gs] 显示参数列表, 当前文件显示在 "[]" 中
|:all| :all or :sall 为参数列表中的每个文件打开一个窗口
|:wn| :wn[ext][!] 写入文件并编辑下一个
|:wn| :wn[ext][!] {file} 写入 {file} 并编辑下一个文件, 除非
文件 {file} 已经存在. 使用 !, 覆盖
已存在的文件.
|:wN| :wN[ext][!] [file] 写入文件并编辑前一个文件
在当前窗口 新建窗口 ~
|:argument| :argu[ment] N :sar[gument] N 编辑文件 N
|:next| :n[ext] :sn[ext] 编辑下一个文件
|:next_f| :n[ext] {arglist} :sn[ext] {arglist} 定义新的文件列表并编辑
其中的第一个
|:Next| :N[ext] :sN[ext] 编辑前一个文件
|:first| :fir[st] :sfir[st] 编辑第一个文件
|:last| :la[st] :sla[st] 编辑最后一个文件
------------------------------------------------------------------------------
*Q_wq* 写入和退出
|:w| :[range]w[rite][!] 写入当前文件
|:w_f| :[range]w[rite] {file} 写入至文件 {file}, 除非其已经存在
|:w_f| :[range]w[rite]! {file} 写入至文件 {file}. 覆盖已存在的文件
|:w_a| :[range]w[rite][!] >> 添加至当前文件
|:w_a| :[range]w[rite][!] >> {file} 添加至 {file}.
|:w_c| :[range]w[rite] !{cmd} 执行命令 {cmd},以 [range] 代表的行
作为标准输入。
|:up| :[range]up[date][!] 如果当前文件被改动则写入
|:wall| :wa[ll][!] 写入所有被改动的缓冲区
|:q| :q[uit] 退出当前缓冲, 除非已经做了改动. 如果没有其它
非帮助的缓冲, 退出 Vim
|:q| :q[uit]! 强制退出当前缓冲, 放弃所有的改动. 如果没有其它
非帮助的缓冲, 退出 Vim
|:qa| :qa[ll] 退出 Vim, 除非作了改动
|:qa| :qa[ll]! 退出 Vim, 废除所有改动
|:cq| :cq 推出,不写入文件并返回错误代码
|:wq| :wq[!] 写入当前文件并退出
|:wq| :wq[!] {file} 写入文件 {file} 并退出
|:xit| :x[it][!] [file] 同 ":wq" 但是仅当有改动时写入
|ZZ| ZZ 同 ":x".
|ZQ| ZQ 同 ":q!".
|:xall| :xa[ll][!] or :wqall[!]
写入所有改动的缓冲并退出
|:stop| :st[op][!] 挂起 VIM 或开始一个新 shell. 如果设置了 'aw' 选项
并没有给出 [!] 则写入缓冲.
|CTRL-Z| CTRL-Z 同 ":stop"
------------------------------------------------------------------------------
*Q_st* 启动 VIM
|-vim| vim [options] 启动vim并开起一个空白缓冲
|-file| vim [options] {file} .. 启动并编辑一个或多个文件
|--| vim [options] - 从标准输入读入文件
|-tag| vim [options] -t {tag} 编辑于标签 {tag} 关联的文件
|-qf| vim [options] -q [fname] 以快速纠正模式开始编辑,
显示第一个错误.
Vim 参数:
|-gui| -g 启动 GUI (同时允许其他选项)
|-+| +[num] 至光标于第 [num] 行(缺省: 末行)
|-+c| +{command} 载入文件后执行命令 {command}
|-+/| +/{pat} {file} .. 至光标于第一次出现 {pat} 处
|-v| -v Vi 模式, 以普通模式起动 ex
|-e| -e Ex 模式, 以 Ex 模式启动 vim
|-R| -R 只读模式, 隐含 -n
|-m| -m 禁止修改 (重置 'write' 选项)
|-b| -b 二进制模式
|-l| -l lisp 模式
|-A| -A 阿拉伯模式 ('arabic' is set)
|-F| -F Farsi 模式 ('fkmap' 和 'rightleft' are set)
|-H| -H Hebrew 模式 ('hkmap' and 'rightleft' are set)
|-V| -V Verbose, 给出更多信息
|-C| -C 兼容, 设置 'compatible' 选项
|-N| -N 不兼容, 复位 'compatible' 选项
|-r| -r 给出交换文件列表
|-r| -r {file} .. 恢复中断的编辑
|-n| -n 不创建交换文件
|-o| -o [num] 打开 [num] 个窗口 (缺省: 每个文件一个窗口)
|-f| -f GUI: 前台进程, 不调用 fork
Amiga: do not restart VIM to open a window (for
e.g., mail)
|-s| -s {scriptin} 先从文件 {scriptin} 读入命令
|-w| -w {scriptout} 把键入的字符写进文件 {scriptout} (添加)
|-W| -W {scriptout} 把键入的字符写进文件 {scriptout} (覆盖)
|-T| -T {terminal} 设置终端名
|-d| -d {device} Amiga: open {device} to be used as a console
|-u| -u {vimrc} 从文件 {vimrc} 而非其它文件读入初始化命令
|-U| -U {gvimrc} 同上, 但用于启动 GUI 时
|-i| -i {viminfo} 从文件 {viminfo} 而不是其它文件读入 info
|---| -- 结束选项, 其余的参数都将是文件名
|--help| --help 显示参数列表并退出
|--version| --version 显示版本信息并退出
|--| - 从标准输入读入文件
------------------------------------------------------------------------------
*Q_ac* 自动命令
|viminfo-file| 在启动时读入寄存器, 标记, 历史记录, 退出时存储这些信息.
|:rviminfo| :rv[iminfo] [file] 从文件 [file] 读入 viminfo 信息
|:rviminfo| :rv[iminfo]! [file] 同上, 但覆盖已存在的信息
|:wviminfo| :wv[iminfo] [file] 向文件 [file] 中加入 viminfo 信息
|:wviminfo| :wv[iminfo]! [file] 向文件 [file] 中加入 viminfo 信息
|modeline| 当编辑一个文件时自动设定的选项
|modeline| vim:{set-arg}: .. 至于文件的第一行或最后一行
(参见 'ml' 选项), {set-arg} 被用于
":set" 命令的参数
|autocommand| 特定时间发生时自动执行命令
|:autocmd| :au 列出所由自动命令
|:autocmd| :au {event} 列出事件 {event} 的所由自动命令
|:autocmd| :au {event} {pat} 列出事件 {event} 的所由自动命令
并使用文件匹配 {pat}
|:autocmd| :au {event} {pat} {cmd} 为事件 {event} 及文件匹配 {pat} 加入
新的自动命令
|:autocmd| :au! 清除所有自动命令
|:autocmd| :au! {event} 清除所有事件 {event} 的自动命令
Remove all autocommands for {event}
|:autocmd| :au! * {pat} 清除所有文件匹配 {pat} 的自动命令
|:autocmd| :au! {event} {pat} 清除所有文件匹配 {pat} 及事件 {event} 的自动命令
|:autocmd| :au! {event} {pat} {cmd} 清除所有文件匹配 {pat} 及事件 {event} 的
自动命令并加入新的
------------------------------------------------------------------------------
*Q_wi* 多窗口命令
|CTRL-W_s| CTRL-W s 或 :split 将窗口分割成两部分
|:split_f| :split {file} 分隔窗口并在其中一个编辑 {file}
|:sfind| :sf[ind] {file} 分隔窗口, 从 {path} 中找到文件 {file}
并编辑之
|:vsplit| :vsplit {file} 同上,但垂直分割
|:vertical| :vertical {cmd} 使命令 {cmd} 垂直分割
|CTRL-W_]| CTRL-W ] 分割窗口并跳转至光标下的标签
|CTRL-W_f| CTRL-W f 分隔窗口并编辑光标下的文件
|CTRL-W_^| CTRL-W ^ 分隔窗口并编辑 alternate file
|CTRL-W_n| CTRL-W n 或 :new 创建新空白窗口
|CTRL-W_q| CTRL-W q 或 :q[uit] 退出编辑并关闭窗口
|CTRL-W_c| CTRL-W c 或 :cl[ose] 隐藏当前缓冲区并关闭窗口
|CTRL-W_o| CTRL-W o 或 :on[ly] 使当前窗口成为唯一窗口
|CTRL-W_j| CTRL-W j 跳转至下方窗口
|CTRL-W_k| CTRL-W k 跳转至上方窗口
|CTRL-W_CTRL-W| CTRL-W CTRL-W 移动光标至下方窗口 (折转)
|CTRL-W_W| CTRL-W W 移动光标至上方窗口 (折转)
|CTRL-W_t| CTRL-W t 跳转至顶端窗口
|CTRL-W_b| CTRL-W b 跳转至底端窗口
|CTRL-W_p| CTRL-W p 跳转至上一次激活的窗口
|CTRL-W_r| CTRL-W r 向下旋转窗口
|CTRL-W_R| CTRL-W R 向上旋转窗口
|CTRL-W_x| CTRL-W x 将当前窗口于下一个窗口对调
|CTRL-W_=| CTRL-W = 使所有窗口等高
|CTRL-W_-| CTRL-W - 减少当前窗口高度
|CTRL-W_+| CTRL-W + 增加当前窗口高度
|CTRL-W__| CTRL-W _ 设置当前窗口高度 (缺省: 很高)
------------------------------------------------------------------------------
*Q_bu* 缓冲区列表命令
|:buffers| :buffers 或 :files 列出所有已知的缓冲和文件名
|:ball| :ball 或 :sball 编辑所有的缓冲
|:unhide| :unhide 或 :sunhide 编辑所有载入的缓冲
|:badd| :badd {fname} 加入文件名 {fname} 到列表中
|:bunload| :bunload[!] [N] 从内存中卸载缓冲 [N]
|:bdelete| :bdelete[!] [N] 从内存中卸载缓冲 [N] 并从列表中
删除
当前窗口内 新窗口内 ~
|:buffer| :[N]buffer [N] :[N]sbuffer [N] 转到参数/缓冲 N
|:bnext| :[N]bnext [N] :[N]sbnext [N] 转到后面的第 N 个参数/缓冲
|:bNext| :[N]bNext [N] :[N]sbNext [N] 转到前面的第 N 个参数/缓冲
|:bprevious| :[N]bprevious [N] :[N]sbprevious [N] 转到前面的第 N 个参数/缓冲
|:bfirst| :bfirst :sbfirst 转到第一个参数/缓冲
|:blast| :blast :sblast 转到最后一个参数/缓冲
|:bmodified| :[N]bmod [N] :[N]sbmod [N] 转到第 N 个被改动了的缓冲
------------------------------------------------------------------------------
*Q_sy* 语法高亮
|:syn-on| :syntax on 开始使用语法加亮
|:syn-off| :syntax off 停止使用语法加亮
|:syn-keyword| :syntax keyword {group-name} {keyword} ..
添加语法关键字项
|:syn-match| :syntax match {group-name} {pattern} ...
加入语法匹配项
|:syn-region| :syntax region {group-name} {pattern} ...
添加语法区域项
|:syn-sync| :syntax sync [ccomment | lines {N} | ...]
设置语法加亮的同步方式
|:syntax| :syntax [list] 列出当前语法项
|:syn-clear| :syntax clear 清除所有语法信息
|:highlight| :highlight clear 清除所有加亮信息
|:highlight| :highlight {group-name} {key}={arg} ..
为语法组 {group-name} 设置加亮
|:filetype| :filetype on 开启文件类型侦测, 不包括
语法高亮
|:filetype| :filetype plugin indent on
开启文件类型侦测, 包括
包括自动缩进及设置
------------------------------------------------------------------------------
*Q_gu* GUI 命令
|:gui| :gui UNIX: 启动 GUI
|:gui| :gui {fname} .. 同上, 并编辑 {fname} ..
|:menu| :menu 列出所有菜单
|:menu| :menu {mpath} 列出 {mpath} 下的所有菜单
|:menu| :menu {mpath} {rhs} 将 {lhs} 加入菜单 {mpath}
|:menu| :menu {pri} {mpath} {rhs}
同上, 并带有优先权 {pri}
|:menu| :menu ToolBar.{name} {rhs}
将 {lhs} 加入工具条
|:tmenu| :tmenu {mpath} {text} 为菜单 {mpath} 加入 tooltip
|:unmenu| :unmenu {mpath} 删除菜单 {mpath}
------------------------------------------------------------------------------
*Q_fo* 折叠
|'foldmethod'| set foldmethod=manual 手动折叠
set foldmethod=indent 按照缩近折叠
set foldmethod=expr 按照表达式 'foldexpr' 折叠
set foldmethod=syntax 按照语法区域折叠
set foldmethod=marker 按照标记 'foldmarkers' 折叠
|zf| zf{motion} 操作符: 手动定义一个折叠
|:fold| :{range}fold 将范围 {range} 包括的行定义为一个折叠
|zd| zd 删除光标下的一个折叠
|zD| zD 删除光标下的所有折叠
|zo| zo 打开光标下的折叠
|zO| zO 打开光标下的所有折叠
|zc| zc 关闭光标下的一个折叠
|zC| zC 关闭光标下的所有折叠
|zm| zm 折起更多: 减少 'foldlevel'
|zM| zM 关闭所有折叠: 置 'foldlevel' 为0
|zr| zr 减少折叠: 增加 'foldlevel'
|zR| zR 打开所有折叠: 置 'foldlevel' 为最大
|zn| zn 什么也不折叠: 重置 'foldenable'
|zN| zN 正常折叠: 置 'foldenable'
|zi| zi 反转 'foldenable'[/code:1]
以code格式格式化代码
---------------------------------------------
11/09/04 MichaelBibby 呈上
|
|