📄 help.txt
字号:
Context-sensitive completion on the command-line:|c_wildchar| 'wildchar' (default: <Tab>) do completion on the pattern in front of the cursor. If there are multiple matches, beep and show the first one; further 'wildchar' will show the next ones.|c_CTRL-D| CTRL-D list all names that match the pattern in front of the cursor|c_CTRL-A| CTRL-A insert all names that match pattern in front of cursor|c_CTRL-L| CTRL-L insert longest common part of names that match pattern|c_CTRL-N| CTRL-N after 'wildchar' with multiple matches: go to next match|c_CTRL-P| CTRL-P after 'wildchar' with multiple matches: go to previous match------------------------------------------------------------------------------*X_ra* Ex ranges|:range| , separates two line numbers|:range| ; idem, set cursor to the first line number before interpreting the second one|:range| {number} an absolute line number|:range| . the current line|:range| $ the last line in the file|:range| % equal to 1,$ (the entire file)|:range| * equal to '<,'> (visual area)|:range| 't position of mark t|:range| /{pattern}[/] the next line where {pattern} matches|:range| ?{pattern}[?] the previous line where {pattern} matches|:range| +[num] add [num] to the preceding line number (default: 1)|:range| -[num] subtract [num] from the preceding line number (default: 1)------------------------------------------------------------------------------*X_ex* Special Ex characters|:bar| | separates two commands (not for ":global" and ":!")|:quote| " begins comment|:_%| % current file name (only where a file name is expected)|:_#| #[num] alternate file name [num] (only where a file name is expected) Note: The next four are typed literally; these are not special keys!|:<cword>| <cword> word under the cursor (only where a file name is expected)|:<cWORD>| <cWORD> WORD under the cursor (only where a file name is expected) (see |WORD|)|:<cfile>| <cfile> file name under the cursor (only where a file name is expected)|:<afile>| <afile> file name for autocommand (only where a file name is expected)|:<sfile>| <sfile> file name of a ":source"d file, within that file (only where a file name is expected) After "%", "#", "<cfile>", "<sfile>" or "<afile>" |::p| :p full path |::h| :h head (file name removed) |::t| :t tail (file name only) |::r| :r root (extension removed) |::e| :e extension |::s| :s/{pat}/{repl}/ substitute {pat} with {repl}------------------------------------------------------------------------------*X_ed* Editing a file|:edit_f| :e[dit] {file} Edit {file}, unless changes have been made.|:edit!_f| :e[dit]! {file} Edit {file} always. Discard any changes.|:edit| :e[dit] Reload the current file, unless changes have been made.|:edit!| :e[dit]! Reload the current file always. Discard any changes.|:find| :fin[d][!] {file} Find {file} in 'path' and edit it.|CTRL-^| N CTRL-^ Edit alternate file N (equivalent to ":e #N").|gf| gf or ]f Edit the file whose name is under the cursor|:pwd| :pwd Print the current directory name.|:cd| :cd [path] Change the current directory to [path].|:cd-| :cd - Back to previous current directory.|:file| :f[ile] Print the current file name and the cursor position.|:file| :f[ile] {name} Set the current file name to {name}.|:files| :files Show alternate file names.------------------------------------------------------------------------------*X_fl* Using the argument list |argument-list||:args| :ar[gs] Print the argument list, with the current file in "[]".|:all| :all or :sall Open a window for every file in the arg list.|:wn| :wn[ext][!] Write file and edit next file.|:wn| :wn[ext][!] {file} Write to {file} and edit next file, unless {file} exists. With !, overwrite existing file.|:wN| :wN[ext][!] [file] Write file and edit previous file. in current window in new window ~|:argument| :argu[ment] N :sar[gument] N Edit file N|:next| :n[ext] :sn[ext] Edit next file|:next_f| :n[ext] {arglist} :sn[ext] {arglist} define new arg list and edit first file|:Next| :N[ext] :sN[ext] Edit previous file|:rewind| :rew[ind][!] :srew[ind] Edit first file|:last| :last :slast Edit last file------------------------------------------------------------------------------*X_wq* Writing and quitting|:w| :[range]w[rite][!] Write to the current file.|:w_f| :[range]w[rite] {file} Write to {file}, unless it already exists.|:w_f| :[range]w[rite]! {file} Write to {file}. Overwrite an existing file.|:w_a| :[range]w[rite][!] >> Append to the current file.|:w_a| :[range]w[rite][!] >> {file} Append to {file}.|:w_c| :[range]w[rite] !{cmd} Execute {cmd} with [range] lines as standard input.|:up| :[range]up[date][!] write to current file if modified|:wall| :wall[!] write all changed buffers|:q| :q[uit] Quit current buffer, unless changes have been made. Exit Vim when there are no other non-help buffers|:q| :q[uit]! Quit current buffer always, discard any changes. Exit Vim when there are no other non-help buffers|:qa| :qall Exit Vim, unless changes have been made.|:qa| :qall! Exit Vim always, discard any changes.|:cq| :cq Quit without writing and return error code.|:wq| :wq[!] Write the current file and exit.|:wq| :wq[!] {file} Write to {file} and exit.|:xit| :x[it][!] [file] Like ":wq" but write only when changes have been made|ZZ| ZZ Same as ":x".|ZQ| ZQ Same as ":q!".|:xall| :xall[!] or :wqall[!] Write all changed buffers and exit|:stop| :st[op][!] Suspend VIM or start new shell. If 'aw' option is set and [!] not given write the buffer.|CTRL-Z| CTRL-Z Same as ":stop"------------------------------------------------------------------------------*X_st* Starting VIM|-vim| vim [options] start editing with an empty buffer|-file| vim [options] {file} .. start editing one or more files|--| vim [options] - read file from stdin|-tag| vim [options] -t {tag} edit the file associated with {tag}|-qf| vim [options] -q [fname] start editing in QuickFix mode, display the first error Vim arguments:|-gui| -g start GUI (also allows other options)|-+| +[num] put the cursor at line [num] (default: last line)|-+c| +{command} execute {command} after loading the file|-+/| +/{pat} {file} .. put the cursor at the first occurrence of {pat}|-v| -v Vi mode, start ex in Normal mode|-e| -e Ex mode, start vim in Ex mode|-R| -R Read-only mode, implies -n|-m| -m modifications not allowed (resets 'write' option)|-b| -b binary mode|-l| -l lisp mode|-F| -F Farsi mode ('fkmap' and 'rightleft' are set)|-H| -H Hebrew mode ('hkmap' and 'rightleft' are set)|-V| -V Verbose, give informative messages|-C| -C Compatible, set the 'compatible' option|-N| -N Nocompatible, reset the 'compatible' option|-r| -r give list of swap files|-r| -r {file} .. recover aborted edit session|-n| -n do not create a swap file|-o| -o [num] open [num] windows (default: one for each file)|-f| -f GUI: foreground process, don't fork Amiga: do not restart VIM to open a window (for e.g., mail)|-s| -s {scriptin} first read commands from the file {scriptin}|-w| -w {scriptout} write typed chars to file {scriptout} (append)|-W| -W {scriptout} write typed chars to file {scriptout} (overwrite)|-T| -T {terminal} set terminal name|-d| -d {device} Amiga: open {device} to be used as a console|-u| -u {vimrc} read inits from {vimrc} instead of other inits|-U| -U {gvimrc} idem, for when starting the GUI|-i| -i {viminfo} read info from {viminfo} instead of other files|---| -- end of options, other arguments are file names|--help| --help show list of arguments and exit|--version| --version show version info and exit|--| - Read file from stdin.------------------------------------------------------------------------------*X_ac* Automatic Commands|viminfo-file| Read registers, marks, history at startup, save when exiting.|:rviminfo| :rv[iminfo] [file] Read info from viminfo file [file]|:rviminfo| :rv[iminfo]! [file] idem, overwrite existing info|:wviminfo| :wv[iminfo] [file] Add info to viminfo file [file]|:wviminfo| :wv[iminfo]! [file] Write info to viminfo file [file]|modeline| Automatic option setting when editing a file|modeline| vim:{set-arg}: .. In the first and last lines of the file (see 'ml' option), {set-arg} is given as an argument to ":set"|autocommand| Automatic execution of commands on certain events.|:autocmd| :au List all autocommands|:autocmd| :au {event} List all autocommands for {event}|:autocmd| :au {event} {pat} List all autocommands for {event} with {pat}|:autocmd| :au {event} {pat} {cmd} Enter new autocommands for {event} with {pat}|:autocmd| :au! Remove all autocommands|:autocmd| :au! {event} Remove all autocommands for {event}|:autocmd| :au! * {pat} Remove all autocommands for {pat}|:autocmd| :au! {event} {pat} Remove all autocommands for {event} with {pat}|:autocmd| :au! {event} {pat} {cmd} Remove all autocommands for {event} with {pat} and enter new one------------------------------------------------------------------------------*X_wi* Multi-window functions|CTRL-W_s| CTRL-W s or :split Split window into two parts|:split_f| :split {file} Split window and edit {file} in one of them|:sfind| :sf[ind] {file} Split window, find {file} in 'path' and edit it.|CTRL-W_]| CTRL-W ] Split window and jump to tag under cursor|CTRL-W_f| CTRL-W f Split window and edit file name under the cursor|CTRL-W_CTRL-^| CTRL-W CTRL-^ Split window and edit alternate file|CTRL-W_n| CTRL-W n or :new Create new empty window|CTRL-W_q| CTRL-W q or :q[uit] Quit editing and close window|CTRL-W_c| CTRL-W c or :cl[ose] Make buffer hidden and close window|CTRL-W_o| CTRL-W o or :on[ly] Make current window only one on the screen|CTRL-W_j| CTRL-W j Move cursor to window below|CTRL-W_k| CTRL-W k Move cursor to window above|CTRL-W_CTRL-W| CTRL-W CTRL-W Move cursor to window below (wrap)|CTRL-W_W| CTRL-W W Move cursor to window above (wrap)|CTRL-W_t| CTRL-W t Move cursor to top window|CTRL-W_b| CTRL-W b Move cursor to bottom window|CTRL-W_p| CTRL-W p Move cursor to previous active window|CTRL-W_r| CTRL-W r Rotate windows downwards|CTRL-W_R| CTRL-W R Rotate windows upwards|CTRL-W_x| CTRL-W x Exchange current window with next one|CTRL-W_=| CTRL-W = Make all windows equal height|CTRL-W_-| CTRL-W - Decrease current window height|CTRL-W_+| CTRL-W + Increase current window height|CTRL-W__| CTRL-W _ Set current window height (default: very high)------------------------------------------------------------------------------*X_bu* Buffer list functions|:buffers| :buffers or :files list all known buffer and file names|:ball| :ball or :sball edit all args/buffers|:unhide| :unhide or :sunhide edit all loaded buffers|:badd| :badd {fname} add file name {fname} to the list|:bunload| :bunload[!] [N] unload buffer [N] from memory|:bdelete| :bdelete[!] [N] unload buffer [N] and delete it from the buffer list in current window in new window ~|:buffer| :[N]buffer [N] :[N]sbuffer [N] to arg/buf N|:bnext| :[N]bnext [N] :[N]sbnext [N] to Nth next arg/buf|:bNext| :[N]bNext [N] :[N]sbNext [N] to Nth previous arg/buf|:bprevious| :[N]bprevious [N] :[N]sbprevious [N] to Nth previous arg/buf|:brewind| :brewind :sbrewind to first arg/buf|:blast| :blast :sblast to last arg/buf|:bmodified| :[N]bmod [N] :[N]sbmod [N] to Nth modified buf------------------------------------------------------------------------------*X_sy* Syntax Highlighting|:syn-on| :syntax on start using syntax highlighting|:syn-off| :syntax off stop using syntax highlighting|:syn-keyword| :syntax keyword {group-name} {keyword} .. add a syntax keyword item|:syn-match| :syntax match {group-name} {pattern} ... add syntax match item|:syn-region| :syntax region {group-name} {pattern} ... add syntax region item|:syn-sync| :syntax sync [ccomment | lines {N} | ...] tell syntax how to sync|:syntax| :syntax [list] list current syntax items|:syn-clear| :syntax clear clear all syntax info|:highlight| :highlight clear clear all highlight info|:highlight| :highlight {group-name} {key}={arg} .. set highlighting for {group-name}|:filetype| :filetype on switch on file type detection, without syntax highlighting------------------------------------------------------------------------------*X_gu* GUI commands|:gui| :gui UNIX: start the GUI|:gui| :gui {fname} .. idem, and edit {fname} ..|:menu| :menu list all menus|:menu| :menu {mpath} list menus starting with {mpath}|:menu| :menu {mpath} {rhs} add menu {mpath}, giving {lhs}|:menu| :menu {pri} {mpath} {rhs} idem, with priorities {pri}|:menu| :menu ToolBar.{name} {rhs} add toolbar item, giving {lhs}|:tmenu| :tmenu {mpath} {text} add tooltip to menu {mpath}|:unmenu| :unmenu {mpath} remove menu {mpath}------------------------------------------------------------------------------*bars* Bars exampleNow that you've jumped here with CTRL-] or a double mouse click, you can useCTRL-T, CTRL-O, g<RightMouse>, or <C-RightMouse> to go back to where you were.------------------------------------------------------------------------------ vim:ts=8:sw=8:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -