Movatterモバイル変換


[0]ホーム

URL:


Quickref

Nvim:help pages,generated fromsource using thetree-sitter-vimdoc parser.


Quick reference guide

Contents
tag subject tag subject
Q_ct list of help filesQ_re Repeating commandsQ_lr motion: Left-rightQ_km Key mappingQ_ud motion: Up-downQ_ab AbbreviationsQ_tm motion: Text objectQ_op OptionsQ_pa motion: Pattern searchesQ_ur Undo/Redo commandsQ_ma motion: MarksQ_et External commandsQ_vm motion: VariousQ_qf Quickfix commandsQ_ta motion: Using tagsQ_vc Various commandsQ_sc ScrollingQ_ce Ex: Command-line editingQ_in insert: Inserting textQ_ra Ex: RangesQ_ai insert: KeysQ_ex Ex: Special charactersQ_ss insert: Special keysQ_st Starting VimQ_di insert: DigraphsQ_ed Editing a fileQ_si insert: Special insertsQ_fl Using the argument listQ_de change: Deleting textQ_wq Writing and quittingQ_cm change: Copying and movingQ_ac Automatic commandsQ_ch change: Changing textQ_wi Multi-window commandsQ_co change: ComplexQ_bu Buffer list commandsQ_vi Visual modeQ_sy Syntax highlightingQ_to Text objectsQ_gu GUI commandsQ_fo Folding

Q_lr Left-right motions

N is used to indicate an optional count that can be given before the command.
h N hleft (also:CTRL-H,<BS>, or<Left> key)l N lright (also:<Space> or<Right> key)0 0to first character in the line (also:<Home> key)^ ^to first non-blank character in the line$ N $to the next EOL (end of line) position (also:<End> key)g0 g0to first character in screen line (differs from "0" when lines wrap)g^ g^to first non-blank character in screen line (differs from "^" when lines wrap)g$ N g$to last character in screen line (differs from "$" when lines wrap)gm gmto middle of the screen linegM gMto middle of the linebar N |to column N (default: 1)f N f{char}to the Nth occurrence of{char} to the rightF N F{char}to the Nth occurrence of{char} to the leftt N t{char}till before the Nth occurrence of{char} to the rightT N T{char}till before the Nth occurrence of{char} to the left; N ;repeat the last "f", "F", "t", or "T" N times, N ,repeat the last "f", "F", "t", or "T" N times in opposite direction

Q_ud Up-down motions

k N kup N lines (also:CTRL-P and<Up>)j N jdown N lines (also:CTRL-J,CTRL-N,<NL>, and<Down>)- N -up N lines, on the first non-blank character+ N +down N lines, on the first non-blank character (also:CTRL-M and<CR>)_ N _down N-1 lines, on the first non-blank characterG N Ggoto line N (default: last line), on the first non-blank charactergg N gggoto line N (default: first line), on the first non-blank characterN% N %goto line N percentage down in the file; N must be given, otherwise it is the% commandgk N gkup N screen lines (differs from "k" when line wraps)gj N gjdown N screen lines (differs from "j" when line wraps)

Q_tm Text object motions

w N wN words forwardW N WN blank-separatedWORDs forwarde N eforward to the end of the Nth wordE N Eforward to the end of the Nth blank-separatedWORDb N bN words backwardB N BN blank-separatedWORDs backwardge N gebackward to the end of the Nth wordgE N gEbackward to the end of the Nth blank-separatedWORD
) N )N sentences forward( N (N sentences backward} N }N paragraphs forward{ N {N paragraphs backward]] N ]]N sections forward, at start of section[[ N [[N sections backward, at start of section][ N ][N sections forward, at end of section[] N []N sections backward, at end of section[( N [(N times back to unclosed '('[{ N [{N times back to unclosed '{'[m N [mN times back to start of method (for Java)[M N [MN times back to end of method (for Java)]) N ])N times forward to unclosed ')']} N ]}N times forward to unclosed '}']m N ]mN times forward to start of method (for Java)]M N ]MN times forward to end of method (for Java)[# N [#N times back to unclosed "#if" or "#else"]# N ]#N times forward to unclosed "#else" or "#endif"[star N [*N times back to start of comment "/*"]star N ]*N times forward to end of comment "*/"

Q_pa Pattern searches

/ N /{pattern}[/[offset]]<CR>search forward for the Nth occurrence of{pattern}? N ?{pattern}[?[offset]]<CR>search backward for the Nth occurrence of{pattern}/<CR> N /<CR>repeat last search, in the forward direction?<CR> N ?<CR>repeat last search, in the backward directionn N nrepeat last searchN N Nrepeat last search, in opposite directionstar N *search forward for the identifier under the cursor# N #search backward for the identifier under the cursorgstar N g*like "*", but also find partial matchesg# N g#like "#", but also find partial matchesgd gdgoto local declaration of identifier under the cursorgD gDgoto global declaration of identifier under the cursor
pattern Special characters in search patterns
meaning magic nomagic
matches any single character.\. matches start of line^^ matches<EOL>$$ matches start of word\<\< matches end of word\>\>matches a single char from the range[a-z]\[a-z] matches a single char not in the range[^a-z]\[^a-z] matches an identifier char\i\i idem but excluding digits\I\I matches a keyword character\k\k idem but excluding digits\K\K matches a file name character\f\f idem but excluding digits\F\F matches a printable character\p\p idem but excluding digits\P\P matches a white space character\s\s matches a non-white space character\S\S
matches<Esc>\e\e matches<Tab>\t\tmatches<CR>\r\rmatches<BS>\b\b
matches 0 or more of the preceding atom*\* matches 1 or more of the preceding atom\+\+matches 0 or 1 of the preceding atom\=\=matches 2 to 5 of the preceding atom\{2,5} \{2,5} separates two alternatives\|\|group a pattern into an atom\(\)\(\)
search-offset Offsets allowed after search command
[num][num] lines downwards, in column 1 +[num][num] lines downwards, in column 1 -[num][num] lines upwards, in column 1 e[+num][num] characters to the right of the end of the match e[-num][num] characters to the left of the end of the match s[+num][num] characters to the right of the start of the match s[-num][num] characters to the left of the start of the match b[+num][num] identical to s[+num] above (mnemonic: begin) b[-num][num] identical to s[-num] above (mnemonic: begin) ;{search-command}execute{search-command} next

Q_ma Marks and motions

m m{a-zA-Z}mark current position with mark{a-zA-Z}`a{a-z}go to mark {a-z} within current file`A{A-Z}go to mark {A-Z} in any file`0{0-9}go to the position where Vim was previously exited`` ``go to the position before the last jump`quote"go to the position when last editing this file`[[go to the start of the previously operated or put text`]]go to the end of the previously operated or put text`<<go to the start of the (previous) Visual area`>>go to the end of the (previous) Visual area`..go to the position of the last change in this file' '{a-zA-Z0-9[]'"<>.}same as, but on the first non-blank in the line:marks :marksprint the active marksCTRL-O NCTRL-Ogo to Nth older position in jump listCTRL-I NCTRL-Igo to Nth newer position in jump list:ju :ju[mps]print the jump list

Q_vm Various motions

% %find the next brace, bracket, comment, or "#if"/ "#else"/"#endif" in this line and go to its matchH N Hgo to the Nth line in the window, on the first non-blankM Mgo to the middle line in the window, on the first non-blankL N Lgo to the Nth line from the bottom, on the first non-blank
go N gogo to Nth byte in the buffer:go :[range]go[to] [off]go to [off] byte in the buffer

Q_ta Using tags

:ta :ta[g][!]{tag}jump to tag{tag}:ta :[count]ta[g][!]jump to [count]'th newer tag in tag listCTRL-]CTRL-]jump to the tag under cursor, unless changes have been made:ts :ts[elect][!] [tag]list matching tags and select one to jump to:tjump :tj[ump][!] [tag]jump to tag [tag] or select from list when there are multiple matches:ltag :lt[ag][!] [tag]jump to tag [tag] and add matching tags to the location list
:tags :tagsprint tag listCTRL-T NCTRL-Tjump back from Nth older tag in tag list:po :[count]po[p][!]jump back from [count]'th older tag in tag list:tnext :[count]tn[ext][!]jump to [count]'th next matching tag:tp :[count]tp[revious][!] jump to [count]'th previous matching tag:tr :[count]tr[ewind][!]jump to [count]'th matching tag:tl :tl[ast][!]jump to last matching tag
:ptag :pt[ag]{tag}open a preview window to show tag{tag}CTRL-W_}CTRL-W }likeCTRL-] but show tag in preview window:pts :pts[elect]like ":tselect" but show tag in preview window:ptjump :ptj[ump]like ":tjump" but show tag in preview window:pclose :pc[lose]close tag preview windowCTRL-W_zCTRL-W zclose tag preview window

Q_sc Scrolling

CTRL-E NCTRL-Ewindow N lines downwards (default: 1)CTRL-D NCTRL-Dwindow N lines Downwards (default: 1/2 window)CTRL-F NCTRL-Fwindow N pages Forwards (downwards)CTRL-Y NCTRL-Ywindow N lines upwards (default: 1)CTRL-U NCTRL-Uwindow N lines Upwards (default: 1/2 window)CTRL-B NCTRL-Bwindow N pages Backwards (upwards)z<CR> z<CR> or ztredraw, current line at top of windowz. z. or zzredraw, current line at center of windowz- z- or zbredraw, current line at bottom of window
These only work when'wrap' is off:zh N zhscroll screen N characters to the rightzl N zlscroll screen N characters to the leftzH N zHscroll screen half a screenwidth to the rightzL N zLscroll screen half a screenwidth to the left

Q_in Inserting text

a N aappend text after the cursor (N times)A N Aappend text at the end of the line (N times)i N iinsert text before the cursor (N times) (also:<Insert>)I N Iinsert text before the first non-blank in the line (N times)gI N gIinsert text in column 1 (N times)o N oopen a new line below the current line, append text (N times)O N Oopen a new line above the current line, append text (N times):startinsert :star[tinsert][!] start Insert mode, append when [!] used:startreplace :startr[eplace][!] start Replace mode, at EOL when [!] used
in Visual block mode:v_b_I Iinsert the same text in front of all the selected linesv_b_A Aappend the same text after all the selected lines

Q_ai Insert mode keys

insert-index alphabetical index of Insert mode commands
leaving Insert mode:i_<Esc><Esc> end Insert mode, back to Normal modei_CTRL-CCTRL-C like<Esc>, but do not use an abbreviationi_CTRL-OCTRL-O{command} execute{command} and return to Insert mode
moving around:i_<Up> cursor keys move cursor left/right/up/downi_<S-Left> shift-left/right one word left/righti_<S-Up> shift-up/down one screenful backward/forwardi_<End><End> cursor after last character in the linei_<Home><Home> cursor to first character in the line

Q_ss Special keys in Insert mode

i_CTRL-VCTRL-V{char}.. insert character literally, or enter decimal byte valuei_<NL><NL> or<CR> orCTRL-M orCTRL-J begin new linei_CTRL-ECTRL-E insert the character from below the cursori_CTRL-YCTRL-Y insert the character from above the cursor
i_CTRL-ACTRL-A insert previously inserted texti_CTRL-@CTRL-@ insert previously inserted text and stop Insert modei_CTRL-RCTRL-R{register} insert the contents of a register
i_CTRL-NCTRL-N insert next match of identifier before the cursori_CTRL-PCTRL-P insert previous match of identifier before the cursori_CTRL-XCTRL-X ... complete the word before the cursor in various ways
i_<BS><BS> orCTRL-H delete the character before the cursori_<Del><Del> delete the character under the cursori_CTRL-WCTRL-W delete word before the cursori_CTRL-UCTRL-U delete all entered characters in the current linei_CTRL-TCTRL-T insert one shiftwidth of indent in front of the current linei_CTRL-DCTRL-D delete one shiftwidth of indent in front of the current linei_0_CTRL-D 0CTRL-D delete all indent in the current linei_^_CTRL-D ^CTRL-D delete all indent in the current line, restore indent in next line

Q_di Digraphs

:dig :dig[raphs]show current list of digraphs:dig :dig[raphs]{char1}{char2}{number} ...add digraph(s) to the list
In Insert or Command-line mode:i_CTRL-KCTRL-K{char1}{char2} enter digraphi_digraph{char1}<BS>{char2} enter digraph if'digraph' option set

Q_si Special inserts

:r :r [file] insert the contents of [file] below the cursor:r! :r!{command} insert the standard output of{command} below the cursor

Q_de Deleting text

x N xdelete N characters under and after the cursor<Del> N<Del>delete N characters under and after the cursorX N Xdelete N characters before the cursord N d{motion}delete the text that is moved over with{motion}v_d{visual}ddelete the highlighted textdd N dddelete N linesD N Ddelete to the end of the line (and N-1 more lines)J N Jjoin N-1 lines (delete<EOL>s)v_J{visual}Jjoin the highlighted linesgJ N gJlike "J", but without inserting spacesv_gJ{visual}gJlike "{visual}J", but without inserting spaces:d :[range]d [x]delete [range] lines [into register x]

Q_cm Copying and moving text

quote "{char}use register{char} for the next delete, yank, or put:reg :regshow the contents of all registers:reg :reg{arg}show the contents of registers mentioned in{arg}y N y{motion}yank the text moved over with{motion} into a registerv_y{visual}yyank the highlighted text into a registeryy N yyyank N lines into a registerY N Yyank N lines into a registerNote: Mapped to "y$" by default.default-mappingsp N pput a register after the cursor position (N times)P N Pput a register before the cursor position (N times)]p N ]plike p, but adjust indent to current line[p N [plike P, but adjust indent to current linegp N gplike p, but leave cursor after the new textgP N gPlike P, but leave cursor after the new text

Q_ch Changing text

r N r{char}replace N characters with{char}gr N gr{char}replace N characters without affecting layoutR N Renter Replace mode (repeat the entered text N times)gR N gRenter virtual Replace mode: Like Replace mode but without affecting layoutv_b_r{visual}r{char}in Visual block mode: Replace each char of the selected text with{char}
(change = delete text and enter Insert mode)c N c{motion}change the text that is moved over with{motion}v_c{visual}cchange the highlighted textcc N ccchange N linesS N Schange N linesC N Cchange to the end of the line (and N-1 more lines)s N schange N charactersv_b_c{visual}cin Visual block mode: Change each of the selected lines with the entered textv_b_C{visual}Cin Visual block mode: Change each of the selected lines until end-of-line with the entered text
~ N ~switch case for N characters and advance cursorv_~{visual}~switch case for highlighted textv_u{visual}umake highlighted text lowercasev_U{visual}Umake highlighted text uppercaseg~ g~{motion} switch case for the text that is moved over with{motion}gu gu{motion} make the text that is moved over with{motion} lowercasegU gU{motion} make the text that is moved over with{motion} uppercasev_g?{visual}g? perform rot13 encoding on highlighted textg? g?{motion} perform rot13 encoding on the text that is moved over with{motion}
CTRL-A NCTRL-Aadd N to the number at or after the cursorCTRL-X NCTRL-Xsubtract N from the number at or after the cursor
< N <{motion}move the lines that are moved over with{motion} one shiftwidth left<< N <<move N lines one shiftwidth left> N >{motion}move the lines that are moved over with{motion} one shiftwidth right>> N >>move N lines one shiftwidth rightgq N gq{motion}format the lines that are moved over with{motion} to'textwidth' length:ce :[range]ce[nter] [width]center the lines in [range]:le :[range]le[ft] [indent]left-align the lines in [range] (with [indent]):ri :[range]ri[ght] [width]right-align the lines in [range]

Q_co Complex changes

! N !{motion}{command}<CR>filter the lines that are moved over through{command}!! N !!{command}<CR>filter N lines through{command}v_!{visual}!{command}<CR>filter the highlighted lines through{command}:range! :[range]!{command}<CR>filter [range] lines through{command}= N ={motion}filter the lines that are moved over through'equalprg'== N ==filter N lines through'equalprg'v_={visual}=filter the highlighted lines through'equalprg':s :[range]s[ubstitute]/{pattern}/{string}/[g][c]substitute{pattern} by{string} in [range] lines; with [g], replace all occurrences of{pattern}; with [c], confirm each replacement:s :[range]s[ubstitute] [g][c]repeat previous ":s" with new range and options& &Repeat previous ":s" on current line without options:ret :[range]ret[ab][!] [tabstop]set'tabstop' to new value and adjust white space accordingly

Q_vi Visual mode

visual-index list of Visual mode commands.
v vstart highlighting characters } move cursor and useV Vstart highlighting linewise } operator to affectCTRL-VCTRL-Vstart highlighting blockwise } highlighted textv_o oexchange cursor position with start of highlightinggv gvstart highlighting on previous visual areav_v vhighlight characters or stop highlightingv_V Vhighlight linewise or stop highlightingv_CTRL-VCTRL-Vhighlight blockwise or stop highlighting

Q_to Text objects (only in Visual mode or after an operator)

v_aw N awSelect "a word"v_iw N iwSelect "inner word"v_aW N aWSelect "aWORD"v_iW N iWSelect "innerWORD"v_as N asSelect "a sentence"v_is N isSelect "inner sentence"v_ap N apSelect "a paragraph"v_ip N ipSelect "inner paragraph"v_ab N abSelect "a block" (from "[(" to "])")v_ib N ibSelect "inner block" (from "[(" to "])")v_aB N aBSelect "a Block" (from[{ to]})v_iB N iBSelect "inner Block" (from[{ to]})v_a> N a>Select "a <> block"v_i> N i>Select "inner <> block"v_at N atSelect "a tag block" (from<aaa> to </aaa>)v_it N itSelect "inner tag block" (from<aaa> to </aaa>)v_a' N a'Select "a single quoted string"v_i' N i'Select "inner single quoted string"v_aquote N a"Select "a double quoted string"v_iquote N i"Select "inner double quoted string"v_a` N a`Select "a backward quoted string"v_i` N i`Select "inner backward quoted string"

Q_re Repeating commands

. N .repeat last change (with count replaced with N)q q{a-z}record typed characters into register{a-z}q q{A-Z}record typed characters, appended to register{a-z}q qstop recordingQ Qreplay last recorded macro@ N @{a-z}execute the contents of register{a-z} (N times)@@ N @@ repeat previous @{a-z} (N times):@ :@{a-z}execute the contents of register{a-z} as an Ex command:@@ :@@repeat previous :@{a-z}:g :[range]g[lobal]/{pattern}/[cmd]execute Ex command [cmd] (default: ":p") on the lines within [range] where{pattern} matches:g :[range]g[lobal]!/{pattern}/[cmd]execute Ex command [cmd] (default: ":p") on the lines within [range] where{pattern} does NOT match:so :so[urce]{file}read Ex commands from{file}:so :so[urce]!{file}read Vim commands from{file}:sl :sl[eep] [sec]don't do anything for [sec] secondsgs N gsgoto Sleep for N seconds

Q_km Key mapping

:map :ma[p]{lhs}{rhs} map{lhs} to{rhs} in Normal and Visual mode:map! :ma[p]!{lhs}{rhs} map{lhs} to{rhs} in Insert and Command-line mode:noremap :no[remap][!]{lhs}{rhs} same as ":map", no remapping for this{rhs}:unmap :unm[ap]{lhs} remove the mapping of{lhs} for Normal and Visual mode:unmap! :unm[ap]!{lhs} remove the mapping of{lhs} for Insert and Command-line mode:map_l :ma[p] [lhs] list mappings (starting with [lhs]) for Normal and Visual mode:map_l! :ma[p]! [lhs] list mappings (starting with [lhs]) for Insert and Command-line mode:cmap :cmap/:cunmap/:cnoremap like ":map!"/":unmap!"/":noremap!" but for Command-line mode only:imap :imap/:iunmap/:inoremap like ":map!"/":unmap!"/":noremap!" but for Insert mode only:nmap :nmap/:nunmap/:nnoremap like ":map"/":unmap"/":noremap" but for Normal mode only:vmap :vmap/:vunmap/:vnoremap like ":map"/":unmap"/":noremap" but for Visual mode only:omap :omap/:ounmap/:onoremap like ":map"/":unmap"/":noremap" but only for when an operator is pending:mapc :mapc[lear] remove mappings for Normal and Visual mode:mapc :mapc[lear]! remove mappings for Insert and Cmdline mode:imapc :imapc[lear] remove mappings for Insert mode:vmapc :vmapc[lear] remove mappings for Visual mode:omapc :omapc[lear] remove mappings for Operator-pending mode:nmapc :nmapc[lear] remove mappings for Normal mode:cmapc :cmapc[lear] remove mappings for Cmdline mode:mkexrc :mk[exrc][!] [file] write current mappings, abbreviations, and settings to [file] (default: ".exrc"; use ! to overwrite):mkvimrc :mkv[imrc][!] [file] same as :mkexrc, but with default ".nvimrc":mksession :mks[ession][!] [file] like ":mkvimrc", but store current files, windows, etc. too, to be able to continue this session later

Q_ab Abbreviations

:abbreviate :ab[breviate]{lhs}{rhs} add abbreviation for{lhs} to{rhs}:abbreviate :ab[breviate]{lhs} show abbr's that start with{lhs}:abbreviate :ab[breviate] show all abbreviations:unabbreviate :una[bbreviate]{lhs} remove abbreviation for{lhs}:noreabbrev :norea[bbrev] [lhs] [rhs] like ":ab", but don't remap [rhs]:iabbrev :iab/:iunab/:inoreab like ":ab", but only for Insert mode:cabbrev :cab/:cunab/:cnoreab like ":ab", but only forCommand-line mode:abclear :abc[lear] remove all abbreviations:cabclear :cabc[lear] remove all abbr's for Cmdline mode:iabclear :iabc[lear] remove all abbr's for Insert mode

Q_op Options

:set :se[t] show all modified options:set :se[t] all show all options:set :se[t]{option} set boolean option (switch it on), show string or number option:set :se[t] no{option} reset boolean option (switch it off):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}? show value of{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
:options :opt[ions] open a new window to view and set options, grouped by functionality, a one line explanation and links to the help
Short explanation of each option:option-list
'allowrevins''ari' allowCTRL-_ in Insert mode'ambiwidth''ambw' what to do with Unicode chars of ambiguous width'arabic''arab' for Arabic as a default second language'arabicshape''arshape' do shaping for Arabic characters'autochdir''acd' change directory to the file in the current window'autocomplete''ac' enable automatic completion in insert mode'autocompletedelay''acl' delay in msec before menu appears after typing'autocompletetimeout''act' initial decay timeout for autocompletion algorithm'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'belloff''bo' do not ring the bell for these reasons'binary''bin' read/write/edit file in binary mode'bomb' prepend a Byte Order Mark to the file'breakat''brk' characters that may cause a line break'breakindent''bri' wrapped line repeats indent'breakindentopt''briopt' settings for'breakindent''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'cdhome''cdh' change directory to the home directory by ":cd"'cdpath''cd' list of directories searched with ":cd"'cedit' key used to open the command-line window'charconvert''ccv' expression for character encoding conversion'chistory''chi' maximum number of quickfix lists in history'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'cinscopedecls''cinsd' words that are recognized by 'cino-g''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'colorcolumn''cc' columns to highlight'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'complete''cpt' specify how Insert mode completion works'completefunc''cfu' function to be used for Insert mode completion'completeopt''cot' options for Insert mode completion'completeslash''csl' like'shellslash' for completion'completetimeout''cto' initial decay timeout forCTRL-N andCTRL-P'concealcursor''cocu' whether concealable text is hidden in cursor line'conceallevel''cole' whether concealable text is shown or hidden'confirm''cf' ask what to do about unsaved/read-only files'copyindent''ci' make'autoindent' use existing indent structure'cpoptions''cpo' flags for Vi-compatible behavior'cursorbind''crb' move cursor in window as it moves in other windows'cursorcolumn''cuc' highlight the screen column of the cursor'cursorline''cul' highlight the screen line of the cursor'cursorlineopt''culopt' settings for'cursorline''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'diffanchors''dia' list of{address} to force anchoring of a diff'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'encoding''enc' encoding used internally'endoffile''eof' writeCTRL-Z at end of the file'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'eventignore''ei' autocommand events that are ignored'eventignorewin''eiw' autocommand events that are ignored in a window'expandtab''et' use spaces when<Tab> is inserted'exrc''ex' read init files in the current directory'fileencoding''fenc' file encoding for multibyte text'fileencodings''fencs' automatically detected character encodings'fileformat''ff' file format used for file I/O'fileformats''ffs' automatically detected values for'fileformat''fileignorecase''fic' ignore case when using file names'filetype''ft' type of file, used for autocommands'fillchars''fcs' characters to use for displaying special items'findfunc''ffu' function to be called for the:find command'fixendofline''fixeol' make sure last line in file has<EOL>'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'formatexpr''fex' expression used with "gq" command'formatlistpat''flp' pattern used to recognize a list header'formatoptions''fo' how automatic formatting is to be done'formatprg''fp' name of external program used with "gq" command'fsync''fs' whether to invoke fsync() after file write'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'guifontwide''gfw' list of font names for double-wide characters'guioptions''go' GUI: Which components and options are used'guitablabel''gtl' GUI: custom label for a tab page'guitabtooltip''gtt' GUI: custom tooltip for a tab page'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 isabandoned'history''hi' number of command-lines that are remembered'hlsearch''hls' highlight matches with last search pattern'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'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'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'jumpoptions''jop' specifies how jumping is done'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'langremap''lrm' do apply'langmap' to mapped characters'laststatus''ls' tells when last window has status lines'lazyredraw''lz' don't redraw while executing macros'lhistory''lhi' maximum number of location lists in history'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'lispoptions''lop' changes how Lisp indenting is done'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"'makeencoding''menc' encoding of external make/grep commands'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'maxcombine''mco' maximum nr of combining characters displayed'maxfuncdepth''mfd' maximum recursive depth for user functions'maxmapdepth''mmd' maximum recursive depth for mapping'maxmempattern''mmp' maximum memory (in Kbyte) used for pattern search'menuitems''mis' maximum number of items in a menu'mkspellmem''msm' memory used before:mkspell compresses the tree'modeline''ml' recognize modelines at start or end of file'modelineexpr''mle' allow setting expression options from a modeline'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'mousemoveevent''mousemev' report mouse moves with<MouseMove>'mousescroll' amount to scroll by when scrolling with a mouse'mouseshape''mouses' shape of the mouse pointer in different modes'mousetime''mouset' max time between mouse double-click'nrformats''nf' number formats recognized forCTRL-A command'number''nu' print the line number in front of each line'numberwidth''nuw' number of columns used for the line number'omnifunc''ofu' function for filetype-specific completion'opendevice''odev' allow reading/writing devices on MS-Windows'operatorfunc''opfunc' function to be called forg@ operator'packpath''pp' list of directories used for packages'paragraphs''para' nroff macros that separate paragraphs'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'pumheight''ph' maximum number of items to show in the popup menu'pumwidth''pw' minimum width of the popup menu'pyxversion''pyx' Python version used for pyx* commands'quoteescape''qe' escape characters used in a string'readonly''ro' disallow writing the buffer'redrawtime''rdt' timeout for'hlsearch' and:match highlighting'regexpengine''re' default regexp engine to use'relativenumber''rnu' show relative line number in front of each line'report' threshold for reporting nr. of lines changed'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 withCTRL-U andCTRL-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'shada''sd' useshada file upon startup and exiting'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'shelltemp''stmp' whether to use a temp file for shell commands'shellxescape''sxe' characters to escape when'shellxquote' is ('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'showbreak''sbr' string to use at the start of wrapped lines'showcmd''sc' show (partial) command somewhere'showcmdloc''sloc' where to show (partial) command'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'showtabline''stal' tells when the tab pages line is displayed'sidescroll''ss' minimum number of columns to scroll horizontal'sidescrolloff''siso' min. nr. of columns to left and right of cursor'signcolumn''scl' when and how to display the sign column'smartcase''scs' no ignore case when pattern has uppercase'smartindent''si' smart autoindenting for C programs'smarttab''sta'<Tab> in leading whitespace indents by'shiftwidth''smoothscroll''sms' scroll by screen lines when'wrap' is set'softtabstop''sts' number of columns between two soft tab stops'spell' enable spell checking'spellcapcheck''spc' pattern to locate end of a sentence'spellfile''spf' files wherezg andzw store words'spelllang''spl' language(s) to do spell checking for'spelloptions''spo' options for spell checking'spellsuggest''sps' method(s) used to suggest spelling corrections'splitbelow''sb' new window from split is below the current one'splitkeep''spk' determines scroll behavior for split windows'splitright''spr' new window is put right of the current one'startofline''sol' commands move cursor to first non-blank in line'statuscolumn''stc' custom format for the status column'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'switchbuf''swb' sets behavior when switching to another buffer'synmaxcol''smc' maximum column to find syntax items'syntax''syn' syntax to be loaded for current buffer'tabclose''tcl' which tab page to focus when closing a tab'tabline''tal' custom format for the console tab pages line'tabpagemax''tpm' maximum number of tab pages for-p and "tab all"'tabstop''ts' number of columns between two tab stops'tagbsearch''tbs' use binary searching in tags files'tagcase''tc' how to handle case when searching in tags files'tagfunc''tfu' function to get list of tag matches'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'termguicolors''tgc' enable 24-bit RGB color in the TUI'textwidth''tw' maximum width of text that is being inserted'thesaurus''tsr' list of thesaurus files for keyword completion'thesaurusfunc''tsrfu' function to be used for thesaurus 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'ttimeout' time out on mappings'ttimeoutlen''ttm' time out time for key codes in milliseconds'ttytype''tty' alias for'term''undodir''udir' where to store undo files'undofile''udf' save undo information in a file'undolevels''ul' maximum number of changes that can be undone'undoreload''ur' max nr of lines to save for undo on a buffer reload'updatecount''uc' after this many characters flush swap file'updatetime''ut' after this many milliseconds flush swap file'varsofttabstop''vsts' a list of number of columns between soft tab stops'vartabstop''vts' a list of number of columns between tab stops'verbose''vbs' give informative messages'verbosefile''vfile' file to write messages in'viewdir''vdir' directory where to store files with :mkview'viewoptions''vop' specifies what to save for :mkview'virtualedit''ve' when to use virtual editing'visualbell''vb' use visual bell instead of beeping'warn' warn for shell command when buffer was changed'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'wildignorecase''wic' ignore case when completing file names'wildmenu''wmnu' use menu for command line completion'wildmode''wim' mode for'wildchar' command-line expansion'wildoptions''wop' specifies how command line completion is done'winaltkeys''wak' when the windows system handles ALT keys'window''wi' nr of lines to scroll forCTRL-F andCTRL-B'winfixbuf''wfb' keep window focused on a single buffer'winfixheight''wfh' keep window height when opening/closing windows'winfixwidth''wfw' keep window width when opening/closing windows'winheight''wh' minimum number of lines for the current window'winhighlight''winhl' window-local highlighting'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 Undo/Redo commands

u N uundo last N changesCTRL-R NCTRL-Rredo last N undone changesU Urestore last changed line

Q_et External commands

:! :!{command}execute{command} with a shellK Klookup keyword under the cursor with'keywordprg' program (default: "man")

Q_qf Quickfix commands

:cc :cc [nr]display error [nr] (default is the same again):cnext :cndisplay the next error:cprevious :cpdisplay the previous error:clist :cllist all errors:cfile :cfread errors from the file'errorfile':cgetbuffer :cgetblike :cbuffer but don't jump to the first error:cgetfile :cglike :cfile but don't jump to the first error:cgetexpr :cgetelike :cexpr but don't jump to the first error:caddfile :caddfadd errors from the error file to the current quickfix list:caddexpr :cadadd errors from an expression to the current quickfix list:cbuffer :cbread errors from text in a buffer:cexpr :cexread errors from an expression:cquit :cqquit without writing and return error code (to the compiler):make :make [args]start make, read errors, and jump to first error:grep :gr[ep] [args]execute'grepprg' to find matches and jump to the first one

Q_vc Various commands

CTRL-LCTRL-Lclear and redraw the screenCTRL-GCTRL-Gshow current file name (with path) and cursor positionga gashow ascii value of character under cursor in decimal, hex, and octalg8 g8for utf-8 encoding: show byte sequence for character under cursor in hexg_CTRL-G gCTRL-Gshow cursor column, line, and character positionCTRL-CCTRL-Cduring searches: Interrupt the search<Del><Del>while entering a count: delete last character:version :ve[rsion]show version information:normal :norm[al][!]{commands}execute Normal mode commandsgQ gQswitch to "Ex" mode
:redir :redir >{file}redirect messages to{file}:silent :silent[!]{command}execute{command} silently:confirm :confirm{command}quit, write, etc., asking aboutunsaved changes or read-only files:browse :browse{command}open/read/write file, using afile selection dialog

Q_ce Command-line editing

c_<Esc><Esc> abandon command-line (if'wildchar' is<Esc>, type it twice)
c_CTRL-VCTRL-V{char} insert{char} literallyc_CTRL-VCTRL-V{number} enter decimal value of character (up to three digits)c_CTRL-KCTRL-K{char1}{char2} enter digraph (SeeQ_di)c_CTRL-RCTRL-R{register} insert the contents of a register
c_<Left><Left>/<Right> cursor left/rightc_<S-Left><S-Left>/<S-Right> cursor one word left/rightc_CTRL-BCTRL-B/CTRL-E cursor to beginning/end of command-line
c_<BS><BS> delete the character in front of the cursorc_<Del><Del> delete the character under the cursorc_CTRL-WCTRL-W delete the word in front of the cursorc_CTRL-UCTRL-U remove all characters
c_<Up><Up>/<Down> recall older/newer command-line that starts with current commandc_<S-Up><S-Up>/<S-Down> recall older/newer command-line from historyc_CTRL-GCTRL-G next match when'incsearch' is activec_CTRL-TCTRL-T previous match when'incsearch' is active:history :his[tory] show older command-lines
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 onesc_CTRL-DCTRL-Dlist all names that match the pattern in front of the cursorc_CTRL-ACTRL-Ainsert all names that match pattern in front of cursorc_CTRL-LCTRL-Linsert longest common part of names that match patternc_CTRL-NCTRL-Nafter'wildchar' with multiple matches: go to next matchc_CTRL-PCTRL-Pafter'wildchar' with multiple matches: go to previous match

Q_ra Ex ranges

:range ,separates two line numbers:range ;idem, set cursor to the first line numberbefore 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 'tposition 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)

Q_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 seven are typed literally; these are not special keys!:<abuf><abuf>buffer number, for use in an autocommand (only where a file name is expected):<afile><afile>file name, for use in an autocommand (only where a file name is expected):<amatch><amatch>what matched with the pattern, for use in an autocommand (only where a file name is expected):<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) (seeWORD):<cfile><cfile>file name under the cursor (only where a file name is expected):<script><script>file name of a ":source"d file, within that file (only where a file name is expected)
After "%", "#", "<cfile>", "<script>" or "<afile>"::p :pfull path::h :hhead (file name removed)::t :ttail (file name only)::r :rroot (extension removed)::e :eextension::s :s/{pat}/{repl}/substitute{pat} with{repl}

Q_st Starting Vim

-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
Most useful Vim arguments (for full list seestartup-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}-e -e Ex mode, start vim in Ex mode-R -R Read-only mode, implies -n-m -m modifications not allowed (resets'write' option)-d -ddiff-mode-b -b binary mode-l -l lisp mode-A -A Arabic mode ('arabic' is set)-H -H Hebrew mode (Hebrew keymap &'rightleft' are set)-V -V Verbose, give informative messages-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)-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)-u -u{vimrc} read inits from{vimrc} instead of other inits-i -i{shada} read info from{shada} 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

Q_ed Editing a file

Without !: Fail if changes have been made to the current buffer. With !: Discard any changes to the current buffer.:edit_f :e[dit][!]{file}edit{file}:edit :e[dit][!]reload the current file:enew :ene[w][!]edit a new, unnamed buffer:find :fin[d][!]{file}find{file} in'path' and edit it
CTRL-^ NCTRL-^edit alternate file N (equivalent to ":e #N")gf gf or ]fedit the file whose name is under the cursor:pwd :pwdprint 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 :filesshow alternate file names

Q_fl Using the argument listargument-list

:args :ar[gs]print the argument list, with the current file in "[]":all :all or :sallopen 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] Nedit 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:first :fir[st] :sfir[st]edit first file:last :la[st] :sla[st]edit last file

Q_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 :wa[ll][!]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 :qa[ll]exit Vim, unless changes have been made:qa :qa[ll]!exit Vim always, discard any changes:cq :cqquit 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 madeZZ ZZsame as ":x"ZQ ZQsame as ":q!":xall :xa[ll][!] 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 bufferCTRL-ZCTRL-Zsame as ":stop"

Q_ac Automatic Commands

shada-file read registers, marks, history at startup, save when exiting.
:rshada :rsh[ada] [file]read info from ShaDa file [file]:rshada :rsh[ada]! [file]idem, overwrite existing info:wshada :wsh[ada] [file]add info to ShaDa file [file]:wshada :wsh[ada]! [file]write info to ShaDa file [file]
modeline Automatic option setting when editing a file
modeline vim:{set-arg}: ..In the first and last lines of thefile (see'ml' option),{set-arg} isgiven 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

Q_wi Multi-window commands

CTRL-W_sCTRL-W s or :splitsplit window into two parts:split_f :split{file}split window and edit{file} in one of them:vsplit :vsplit{file}same, but split vertically:vertical :vertical{cmd}make{cmd} split vertically
:sfind :sf[ind]{file}split window, find{file} in'path' and edit it:terminal :terminal{cmd}open a terminal windowCTRL-W_]CTRL-W ]split window and jump to tag under cursorCTRL-W_fCTRL-W fsplit window and edit file name under the cursorCTRL-W_^CTRL-W ^split window and edit alternate fileCTRL-W_nCTRL-W n or :newcreate new empty windowCTRL-W_qCTRL-W q or :q[uit]quit editing and close windowCTRL-W_cCTRL-W c or :clo[se]make buffer hidden and close windowCTRL-W_oCTRL-W o or :on[ly]make current window only one on the screen
CTRL-W_jCTRL-W jmove cursor to window belowCTRL-W_kCTRL-W kmove cursor to window aboveCTRL-W_CTRL-WCTRL-WCTRL-Wmove cursor to window below (wrap)CTRL-W_WCTRL-W Wmove cursor to window above (wrap)CTRL-W_tCTRL-W tmove cursor to top windowCTRL-W_bCTRL-W bmove cursor to bottom windowCTRL-W_pCTRL-W pmove cursor to previous active window
CTRL-W_rCTRL-W rrotate windows downwardsCTRL-W_RCTRL-W Rrotate windows upwardsCTRL-W_xCTRL-W xexchange current window with next one
CTRL-W_=CTRL-W =make all windows equal height & widthCTRL-W_-CTRL-W -decrease current window heightCTRL-W_+CTRL-W +increase current window heightCTRL-W__CTRL-W _set current window height (default: very high)
CTRL-W_<CTRL-W <decrease current window widthCTRL-W_>CTRL-W >increase current window widthCTRL-W_barCTRL-W |set current window width (default: widest possible)

Q_bu Buffer list commands

:buffers :buffers or :fileslist all known buffer and file names
:ball :ball or :sballedit all args/buffers:unhide :unhide or :sunhideedit 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:bfirst :bfirst :sbfirst to first arg/buf:blast :blast :sblast to last arg/buf:bmodified :[N]bmod [N] :[N]sbmod [N] to Nth modified buf

Q_sy Syntax Highlighting

:syn-on :syntax onstart using syntax highlighting:syn-off :syntax offstop 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 clearclear all syntax info
:highlight :highlight clearclear all highlight info:highlight :highlight{group-name}{key}={arg} ..set highlighting for{group-name}
:filetype :filetype onswitch on file type detection, withoutsyntax highlighting:filetype :filetype plugin indent onswitch on file type detection, withautomatic indenting and settings

Q_gu GUI commands

:menu :menulist all menus:menu :menu{mpath}list menus starting with{mpath}:menu :menu{mpath}{rhs}add menu{mpath}, giving{rhs}:menu :menu{pri}{mpath}{rhs}idem, with priorities{pri}:menu :menu ToolBar.{name}{rhs}add toolbar item, giving{rhs}:tmenu :tmenu{mpath}{text}add tooltip to menu{mpath}:unmenu :unmenu{mpath}remove menu{mpath}

Q_fo Folding

'foldmethod'set foldmethod=manualmanual foldingset foldmethod=indentfolding by indentset foldmethod=exprfolding by'foldexpr'set foldmethod=syntaxfolding by syntax regionsset foldmethod=markerfolding by'foldmarker'
zf zf{motion}operator: Define a fold manually:fold :{range}folddefine a fold for{range} lineszd zddelete one fold under the cursorzD zDdelete all folds under the cursor
zo zoopen one fold under the cursorzO zOopen all folds under the cursorzc zcclose one fold under the cursorzC zCclose all folds under the cursor
zm zmfold more: decrease'foldlevel'zM zMclose all folds: make'foldlevel' zerozr zrreduce folding: increase'foldlevel'zR zRopen all folds: make'foldlevel' max.
zn znfold none: reset'foldenable'zN zNfold normal set'foldenable'zi ziinvert'foldenable'
Main
Commands index
Quick reference

Quick reference guide
Left-right motions
Up-down motions
Text object motions
Pattern searches
Marks and motions
Various motions
Using tags
Scrolling
Inserting text
Insert mode keys
Special keys in Insert mode
Digraphs
Special inserts
Deleting text
Copying and moving text
Changing text
Complex changes
Visual mode
Text objects (only in Visual mode or after an operator)
Repeating commands
Key mapping
Abbreviations
Options
Undo/Redo commands
External commands
Quickfix commands
Various commands
Command-line editing
Ex ranges
Special Ex characters
Starting Vim
Editing a file
Using the argument list|argument-list|
Writing and quitting
Automatic Commands
Multi-window commands
Buffer list commands
Syntax Highlighting
GUI commands
Folding

[8]ページ先頭

©2009-2025 Movatter.jp