quickref.txt ForVim version 9.2. Last change: 2026 Feb 14VIM REFERENCE MANUAL by Bram Moolenaar Quickreference guidequickrefContents tag subject tag subjectQ_ctlist ofhelp filesQ_re Repeating commandsQ_lr motion: Left-rightQ_km KeymappingQ_ud motion: Up-downQ_abAbbreviationsQ_tm motion: TextobjectQ_op OptionsQ_pa motion:Pattern searchesQ_ur Undo/Redo commandsQ_ma motion: MarksQ_et External commandsQ_vm motion: VariousQ_qfQuickfix commandsQ_ta motion: UsingtagsQ_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 Editinga fileQ_si insert:Special insertsQ_fl Using the argumentlistQ_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 Bufferlist commandsQ_viVisual modeQ_sySyntax highlightingQ_to TextobjectsQ_guGUI commandsQ_foFolding------------------------------------------------------------------------------Nis used to indicate an optionalcount that can be given before the command.------------------------------------------------------------------------------Q_lr Left-right motionshNhleft (also:CTRL-H,<BS>, or<Left> key)lNlright (also:<Space> or<Right> key)00to first character in the line (also:<Home> key)^^to first non-blank character in the line$N$to the last character in the line (N-1 lines lower) (also:<End> key)g0g0to 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$Ng$to last character in screen line (differs from "$" when lines wrap)gmgmto middle of the screen linegMgMto middle of the linebarN |to columnN (default: 1)fN f{char}to the Nth occurrence of{char} to the rightFN F{char}to the Nth occurrence of{char} to the lefttN t{char}till before the Nth occurrence of{char} to the rightTN 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 motionskNkupN lines (also:CTRL-P and<Up>)jNjdownN lines (also:CTRL-J,CTRL-N,<NL>, and<Down>)-N-upN lines, on the first non-blank character+N+downN lines, on the first non-blank character (also:CTRL-M and<CR>)_N_down N-1 lines, on the first non-blank characterGNGgoto lineN (default: last line), on the first non-blank characterggNgggoto lineN (default: first line), on the first non-blank characterN%N%goto lineN percentage down in the file;Nmust be given, otherwiseitis the% commandgkNgkupN screen lines (differs from "k" when line wraps)gjNgjdownN screen lines (differs from "j" when line wraps)------------------------------------------------------------------------------Q_tm Textobject motionswNwN words forwardWNWN blank-separatedWORDs forwardeNeforward to theend of the NthwordENEforward to theend of the Nth blank-separatedWORDbNbN words backwardBNBN blank-separatedWORDs backwardgeNgebackward to theend of the NthwordgENgEbackward to theend 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 ofsection[[N[[N sections backward,at start ofsection][N][N sections forward,atend ofsection[]N[]N sections backward,atend ofsection[(N[(N times back to unclosed '('[{N[{N times back to unclosed '{'[mN[mN times back to start ofmethod (for Java)[MN[MN times back toend ofmethod (for Java)])N])N times forward to unclosed ')']}N]}N times forward to unclosed '}']mN]mN times forward to start ofmethod (for Java)]MN]MN times forward toend ofmethod (for Java)[#N[#N times back to unclosed "#if" or "#else"]#N]#N times forward to unclosed "#else" or "#endif"[starN[*N times back to start of comment "/*"]starN]*N times forward toend of comment "*/"------------------------------------------------------------------------------Q_paPattern 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 directionnNnrepeat last searchNNNrepeat last search, in opposite directionstarN *search forward for the identifier under the cursor#N#search backward for the identifier under the cursorgstarNg*like "*", but also findpartial matchesg#Ng#like "#", but also findpartial matchesgdgdgoto local declaration of identifier under the cursorgDgDgoto global declaration of identifier under the cursorpatternSpecial characters in search patternsmeaning magic nomagicmatches any single character.\. matches start of line^^ matches<EOL>$$ matches start ofword\<\< matchesend ofword\>\>matchesa single char from the range[a-z]\[a-z] matchesa single char not in the range[^a-z]\[^a-z] matches an identifier char\i\i idem but excluding digits\I\I matchesa keyword character\k\k idem but excluding digits\K\K matchesa file name character\f\f idem but excluding digits\F\F matchesa printable character\p\p idem but excluding digits\P\P matchesa whitespace character\s\s matchesa non-whitespace character\S\S matches<Esc>\e\e matches<Tab>\t\tmatches<CR>\r\rmatches<BS>\b\b matches0 or more of the preceding atom*\* matches 1 or more of the preceding atom\+\+matches0 or 1 of the preceding atom\=\=matches 2 to 5 of the preceding atom\{2,5} \{2,5} separates two alternatives\|\|groupapattern 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 theend of the match e[-num][num] characters to the left of theend 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 motionsm m{a-zA-Z}mark current position withmark{a-zA-Z}`a `{a-z}go tomark{a-z} within current file`A `{A-Z}go tomark{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 orput text`]`]go to theend of the previously operated orput text`<`<go to the start of the (previous)Visual area`>`>go to theend of the (previous)Visual area`.`.go to the position of the last change in this file' '{a-zA-Z0-9[]'"<>.}sameas `, but on the first non-blank in the line:marks:marks print the active marksCTRL-ONCTRL-Ogo to Nth older position in jumplistCTRL-INCTRL-Igo to Nth newer position in jumplist:ju :ju[mps] print the jumplist------------------------------------------------------------------------------Q_vm Various motions%%find the next brace, bracket, comment, or "#if"/ "#else"/"#endif" in this line andgo to its matchHNHgo to the Nth line in the window, on the first non-blankMMgo to the middle line in the window, on the first non-blankLNLgo to the Nth line from the bottom, on the first non-blankgoNgogo to Nth byte in the buffer:go :[range]go[to][off]go to[off] byte in the buffer------------------------------------------------------------------------------Q_ta Usingtags:ta :ta[g][!]{tag} jump totag{tag}:ta :[count]ta[g][!] jump to[count]'th newertag intaglistCTRL-]CTRL-] jump to thetag under cursor, unless changes have been made:ts :ts[elect][!][tag]list matchingtags and select one to jump to:tjump :tj[ump][!][tag] jump totag[tag] or select fromlist when there are multiple matches:ltag :lt[ag][!][tag] jump totag[tag] and add matchingtags to the locationlist:tags:tags printtaglistCTRL-TNCTRL-T jump back from Nth oldertag intaglist:po :[count]po[p][!] jump back from[count]'th oldertag intaglist:tnext :[count]tn[ext][!] jump to[count]'th next matchingtag:tp :[count]tp[revious][!] jump to[count]'th previous matchingtag:tr :[count]tr[ewind][!] jump to[count]'th matchingtag:tl :tl[ast][!] jump to last matchingtag:ptag :pt[ag]{tag} opena previewwindow to showtag{tag}CTRL-W_}CTRL-W} likeCTRL-] but showtag in previewwindow:pts :pts[elect] like ":tselect" but showtag in previewwindow:ptjump :ptj[ump] like ":tjump" but showtag in previewwindow:pclose :pc[lose] closetag previewwindowCTRL-W_zCTRL-Wz closetag previewwindow------------------------------------------------------------------------------Q_sc ScrollingCTRL-ENCTRL-EwindowN lines downwards (default: 1)CTRL-DNCTRL-DwindowN lines Downwards (default: 1/2 window)CTRL-FNCTRL-FwindowN pages Forwards (downwards)CTRL-YNCTRL-YwindowN lines upwards (default: 1)CTRL-UNCTRL-UwindowN lines Upwards (default: 1/2 window)CTRL-BNCTRL-BwindowN pages Backwards (upwards)z<CR>z<CR> orztredraw, current lineat top ofwindowz.z. orzzredraw, current lineat center ofwindowz-z- orzbredraw, current lineat bottom ofwindowThese only work when'wrap'is off:zhNzhscroll screenN characters to the rightzlNzlscroll screenN characters to the leftzHNzHscroll screen halfa screenwidth to the rightzLNzLscroll screen halfa screenwidth to the left------------------------------------------------------------------------------Q_in Inserting textaNaappend text after the cursor (N times)ANAappend textat theend of the line (N times)iNiinsert text before the cursor (N times) (also:<Insert>)INIinsert text before the first non-blank in the line (N times)gINgIinsert text in column 1 (N times)oNoopena new line below the current line, append text (N times)ONOopena new line above the current line, append text (N times):startinsert :star[tinsert][!] startInsert mode, append when [!] used:startreplace :startr[eplace][!] startReplace mode,at EOL when [!] usedinVisual block mode:v_b_IIinsert the same text in front of all the selected linesv_b_AAappend the same text after all the selected lines------------------------------------------------------------------------------Q_aiInsert mode keysinsert-index alphabeticalindex ofInsert mode commandsleavingInsert mode:i_<Esc><Esc>endInsert mode, back toNormal modei_CTRL-CCTRL-C like<Esc>, butdo not use an abbreviationi_CTRL-OCTRL-O{command} execute{command} and return toInsert modemoving around:i_<Up> cursor keys move cursor left/right/up/downi_<S-Left> shift-left/right oneword 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_ssSpecial keys inInsert modei_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-Einsert the character from below the cursori_CTRL-YCTRL-Yinsert the character from above the cursori_CTRL-ACTRL-Ainsert previously inserted texti_CTRL-@CTRL-@insert previously inserted text and stopInsert modei_CTRL-RCTRL-R{register}insert the contents ofa registeri_CTRL-NCTRL-Ninsert next match of identifier before the cursori_CTRL-PCTRL-Pinsert previous match of identifier before the cursori_CTRL-XCTRL-X... complete theword before the cursor invarious waysi_<BS><BS> orCTRL-H delete the character before the cursori_<Del><Del> delete the character under the cursori_CTRL-WCTRL-W deleteword before the cursori_CTRL-UCTRL-U delete all entered characters in the current linei_CTRL-TCTRL-Tinsert 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-D0CTRL-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_diDigraphs:dig :dig[raphs]show currentlist ofdigraphs:dig :dig[raphs]{char1}{char2}{number}...add digraph(s) to thelistInInsert orCommand-line mode:i_CTRL-KCTRL-K{char1}{char2} enterdigraphi_digraph{char1}<BS>{char2} enterdigraph if'digraph' option set------------------------------------------------------------------------------Q_siSpecial 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 textxNxdeleteN characters under and after the cursor<Del>N<Del>deleteN characters under and after the cursorXNXdeleteN characters before the cursordN d{motion}delete the text thatis moved over with{motion}v_d{visual}ddelete the highlighted textddNdddeleteN linesDNDdelete to theend of the line (and N-1 more lines)JNJjoin N-1 lines (delete<EOL>s)v_J{visual}Jjoin the highlighted linesgJNgJlike "J", but withoutinserting spacesv_gJ{visual}gJlike "{visual}J", but withoutinserting spaces:d :[range]d [x]delete[range] lines [into register x]------------------------------------------------------------------------------Q_cm Copying and moving textquote "{char}use register{char} for the next delete, yank, orput:reg:regshow the contents of allregisters:reg:reg{arg}show the contents ofregisters mentioned in{arg}yN y{motion}yank the text moved over with{motion} intoa registerv_y{visual}yyank the highlighted text intoa registeryyNyyyankN lines intoa registerYNYyankN lines intoa registerpNpputa register after the cursor position (N times)PNPputa register before the cursor position (N times)]pN]plike p, but adjust indent to current line[pN[plike P, but adjust indent to current linegpNgplike p, but leave cursor after the new textgPNgPlike P, but leave cursor after the new text------------------------------------------------------------------------------Q_ch Changing textrN r{char}replaceN characters with{char}grN gr{char}replaceN characters without affecting layoutRNRenterReplace mode (repeat the entered textN times)gRNgRenter virtualReplace mode: LikeReplace mode but without affecting layoutv_b_r{visual}r{char}inVisual block mode:Replace each char of the selected text with{char}(change= delete text and enterInsert mode)cN c{motion}change the text thatis moved over with{motion}v_c{visual}cchange the highlighted textccNccchangeN linesSNSchangeN linesCNCchange to theend of the line (and N-1 more lines)sNschangeN charactersv_b_c{visual}cinVisual block mode: Change each of the selected lines with the entered textv_b_C{visual}CinVisual block mode: Change each of the selected lines until end-of-line with the entered text~N~switchcase forN characters and advance cursorv_~{visual}~switchcase for highlighted textv_u{visual}umake highlighted textlowercasev_U{visual}Umake highlighted textuppercaseg~ g~{motion} switchcase for the text thatis moved over with{motion}gu gu{motion} make the text thatis moved over with{motion}lowercasegU gU{motion} make the text thatis moved over with{motion}uppercasev_g?{visual}g? performrot13 encoding on highlighted textg? g?{motion} performrot13 encoding on the text thatis moved over with{motion}CTRL-ANCTRL-A addN to the numberat or after the cursorCTRL-XNCTRL-X subtractN from the numberat or after the cursor<N <{motion}move the lines that are moved over with{motion} one shiftwidth left<<N<<moveN lines one shiftwidth left>N >{motion}move the lines that are moved over with{motion} one shiftwidth right>>N>>moveN lines one shiftwidth rightgqN 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>filterN 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==filterN 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 andoptions&&Repeat previous ":s" on current line withoutoptions:ret :[range]ret[ab][!][tabstop]set'tabstop' to new value and adjust whitespace accordingly------------------------------------------------------------------------------Q_viVisual modevisual-indexlist ofVisual mode commands.vv start highlighting characters} move cursor and useVV start highlightinglinewise}operator to affectCTRL-VCTRL-V start highlighting blockwise} highlighted textv_oo exchange cursor position with start of highlightinggvgv start highlighting on previous visual areav_vv highlight characters or stop highlightingv_VV highlightlinewise or stop highlightingv_CTRL-VCTRL-V highlight blockwise or stop highlighting------------------------------------------------------------------------------Q_to Textobjects (only inVisual mode or after an operator)v_awNawSelect "aword"v_iwNiwSelect "innerword"v_aWNaWSelect "aWORD"v_iWNiWSelect "innerWORD"v_asNasSelect "asentence"v_isNisSelect "innersentence"v_apNapSelect "aparagraph"v_ipNipSelect "innerparagraph"v_abNabSelect "a block" (from "[(" to "])")v_ibNibSelect "inner block" (from "[(" to "])")v_aBNaBSelect "a Block" (from "[{" to "]}")v_iBNiBSelect "inner Block" (from "[{" to "]}")v_a>Na>Select "a<> block"v_i>Ni>Select "inner<> block"v_atNatSelect "atag block" (from<aaa> to </aaa>)v_itNitSelect "innertag block" (from<aaa> to </aaa>)v_a'Na'Select "a single quotedstring"v_i'Ni'Select "inner single quotedstring"v_aquoteNa"Select "a double quotedstring"v_iquoteNi"Select "inner double quotedstring"v_a`Na`Select "a backward quotedstring"v_i`Ni`Select "inner backward quotedstring"------------------------------------------------------------------------------Q_re Repeating commands.N.repeat last change (withcount 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}qqstoprecording@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 anEx command:@@:@@repeat previous :@{a-z}:g :[range]g[lobal]/{pattern}/[cmd]executeEx command[cmd] (default: ":p") on the lines within[range] where{pattern} matches:g :[range]g[lobal]!/{pattern}/[cmd]executeEx command[cmd] (default: ":p") on the lines within[range] where{pattern} does NOT match:so :so[urce]{file}readEx commands from{file}:so :so[urce]!{file}read Vim commands from{file}:sl :sl[eep][sec]don'tdo anything for[sec] secondsgsNgsgoto Sleep forN seconds------------------------------------------------------------------------------Q_km Keymapping:map :ma[p]{lhs}{rhs} map{lhs} to{rhs} inNormal andVisual mode:map! :ma[p]!{lhs}{rhs} map{lhs} to{rhs} inInsert andCommand-line mode:noremap :no[remap][!]{lhs}{rhs} sameas ":map", no remapping for this{rhs}:unmap :unm[ap]{lhs} remove themapping of{lhs} forNormal andVisual mode:unmap! :unm[ap]!{lhs} remove themapping of{lhs} forInsert andCommand-line mode:map_l :ma[p][lhs]list mappings (starting with[lhs]) forNormal andVisual mode:map_l! :ma[p]![lhs]list mappings (starting with[lhs]) forInsert andCommand-line mode:cmap :cmap/:cunmap/:cnoremap like ":map!"/":unmap!"/":noremap!" but forCommand-line mode only:imap :imap/:iunmap/:inoremap like ":map!"/":unmap!"/":noremap!" but forInsert mode only:nmap :nmap/:nunmap/:nnoremap like ":map"/":unmap"/":noremap" but forNormal mode only:vmap :vmap/:vunmap/:vnoremap like ":map"/":unmap"/":noremap" but forVisual mode only:omap :omap/:ounmap/:onoremap like ":map"/":unmap"/":noremap" but only for when anoperatoris pending:mapc :mapc[lear] remove mappings forNormal andVisual mode:mapc :mapc[lear]! remove mappings forInsert andCmdline mode:imapc :imapc[lear] remove mappings forInsert mode:vmapc :vmapc[lear] remove mappings forVisual mode:omapc :omapc[lear] remove mappings forOperator-pending mode:nmapc :nmapc[lear] remove mappings forNormal mode:cmapc :cmapc[lear] remove mappings forCmdline mode:mkexrc :mk[exrc][!][file] write current mappings, abbreviations, and settings to[file] (default: ".exrc"; use! to overwrite):mkvimrc :mkv[imrc][!][file] sameas ":mkexrc", but with default ".vimrc":mksession :mks[ession][!][file] like ":mkvimrc", but store current files, windows, etc. too, to be able to continue this session later------------------------------------------------------------------------------Q_abAbbreviations: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 allabbreviations: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 forInsert mode:cabbrev :cab/:cunab/:cnoreab like ":ab", but only forCommand-line mode:abclear :abc[lear] remove allabbreviations:cabclear :cabc[lear] remove all abbr's forCmdline mode:iabclear :iabc[lear] remove all abbr's forInsert mode------------------------------------------------------------------------------Q_op Options:set :se[t] show all modifiedoptions:set :se[t] all show all non-termcapoptions:set :se[t]termcap show alltermcapoptions:set :se[t]{option} setboolean option (switchit on), showstring or number option:set :se[t] no{option} resetboolean option (switchit off):set :se[t] inv{option} invertboolean option:set :se[t]{option}={value} set string/number option to{value}:set :se[t]{option}+={value} append{value} tostring option, add{value} to number option:set :se[t]{option}-={value} remove{value} tostring 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 foroptions that have one:setglobal :setg[lobal] like ":set" but set the global value ofa local option:fix :fix[del] set value of't_kD' according to value of't_kb':options :opt[ions] opena newwindow toview and set options, grouped by functionality,a one line explanation and links to thehelpShort explanation of each option:option-list'aleph''al' ASCII code of theletterAleph (Hebrew)'allowrevins''ari' allowCTRL-_ inInsert andCommand-line mode'altkeymap''akm' obsolete option forFarsi'ambiwidth''ambw' what todo withUnicode chars of ambiguous width'antialias''anti'Mac OS X: use smooth, antialiased fonts'arabic''arab' forArabicasa default second language'arabicshape''arshape'do shaping forArabic characters'autochdir''acd' change directory to the file in the currentwindow'autocomplete''ac' enable automatic completion ininsert 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'autoshelldir''asd' change directory to the shell's current directory'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' howbackspace worksat start of line'backup''bk' keepbackup file after overwritinga file'backupcopy''bkc' makebackupasa copy, don't rename the file'backupdir''bdir'list of directories for thebackup file'backupext''bex' extension used for thebackup file'backupskip''bsk' nobackup for files that match these patterns'balloondelay''bdlay' delay in mS beforea balloon may pop up'ballooneval''beval' switch on balloon evaluation in theGUI'balloonevalterm''bevalterm' switch on balloon evaluation in theterminal'balloonexpr''bexpr'expression to show in balloon'belloff''bo'do not ring the bell for these reasons'binary''bin' read/write/edit file in binary mode'bioskey''biosk' MS-DOS: use bios calls for input characters'bomb' prependa Byte OrderMark to the file'breakat''brk' characters that may causea line break'breakindent''bri' wrapped line repeats indent'breakindentopt''briopt' settings for'breakindent''browsedir''bsdir' which directory to start browsing in'bufhidden''bh' what todo when bufferis no longer inwindow'buflisted''bl' whether the buffer shows up in the bufferlist'buftype''bt' special type of buffer'casemap''cmp'specifies howcase of lettersis changed'cdhome''cdh' change directory to thehome directory by ":cd"'cdpath''cd'list of directories searched with ":cd"'cedit' key used to open the command-linewindow'charconvert''ccv'expression for character encoding conversion'chistory''chi' maximum number ofquickfix lists inhistory'cindent''cin'doC program indenting'cinkeys''cink' keys that trigger indent when'cindent'is set'cinoptions''cino' how todo 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 theclipboardas the unnamed register'clipmethod''cpm' specify order of whatclipboard methods to use'cmdheight''ch' number of lines to use for the command-line'cmdwinheight''cwh' height of the command-linewindow'colorcolumn''cc' columns to highlight'columns''co' number of columns in the display'comments''com' patterns that can starta comment line'commentstring''cms'template for comments; used for fold marker'compatible''cp' behave Vi-compatibleas muchas possible'complete''cpt' specify howInsert mode completion works'completefunc''cfu' function to be used forInsert mode completion'completeopt''cot'options forInsert mode completion'completepopup''cpp'options for theInsert mode completion infopopup'completeslash''csl' like'shellslash' for completion'completetimeout''cto' initial decay timeout forCTRL-N andCTRL-P'concealcursor''cocu' whether concealable textis hidden in cursor line'conceallevel''cole' whether concealable textis shown or hidden'confirm''cf' ask what todo 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'cryptmethod''cm' type ofencryption to use for filewriting'cscopepathcomp''cspc' how many components of the path to show'cscopeprg''csprg' command to executecscope'cscopequickfix''csqf' usequickfixwindow forcscope results'cscoperelative''csre' Use cscope.out path basenameas prefix'cscopetag''cst' usecscope fortag commands'cscopetagorder''csto' determines ":cstag" search order'cscopeverbose''csverb' givemessages when addingacscope database'cursorbind''crb' move cursor inwindowasit moves in otherwindows'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 errormessages'define''def'pattern to be used to findamacro definition'delcombine''deco' delete combining characters on their own'dictionary''dict'list of file names used for keyword completion'diff' usediff mode for the currentwindow'diffanchors''dia'list of{address} to force anchoring ofadiff'diffexpr''dex'expression used to obtainadiff file'diffopt''dip'options for usingdiff mode'digraph''dg' enable the entering ofdigraphs inInsert 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'emoji''emo' emoji characters are considered full width'encoding''enc' encoding used internally'endoffile''eof' writeCTRL-Zatend 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 errormessages'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 inInsert mode'eventignore''ei'autocommand events that are ignored'eventignorewin''eiw'autocommand events that are ignored inawindow'expandtab''et' use spaces when<Tab>is inserted'exrc''ex' read.vimrc and.exrc in the current directory'fileencoding''fenc' file encoding formultibyte 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' ignorecase when using file names'filetype''ft' type of file, used forautocommands'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>'fkmap''fk' obsolete option forFarsi'foldclose''fcl' closea fold when the cursor leavesit'foldcolumn''fdc' width of the column used to indicatefolds'foldenable''fen' set to display allfolds open'foldexpr''fde'expression used when'foldmethod'is "expr"'foldignore''fdi' ignore lines when'foldmethod'is "indent"'foldlevel''fdl' closefolds witha level higher than this'foldlevelstart''fdls''foldlevel' whenstarting to edita file'foldmarker''fmr' markers used when'foldmethod'is "marker"'foldmethod''fdm'folding type'foldminlines''fml' minimum number of lines fora fold to be closed'foldnestmax''fdn' maximum fold depth'foldopen''fdo' for which commandsa fold will be opened'foldtext''fdt'expression used to display fora closed fold'formatexpr''fex'expression used with "gq" command'formatlistpat''flp'pattern used to recognizealist header'formatoptions''fo' how automaticformattingis 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'guifontset''gfs' GUI: Names ofmultibyte fonts to be used'guifontwide''gfw'list of font names for double-wide characters'guiheadroom''ghr' GUI: pixels room forwindow decorations'guiligatures''gli'GTK GUI: ASCII characters that can form shapes'guioptions''go' GUI: Which components andoptions are used'guipty' GUI: try to usea pseudo-tty for ":!" commands'guitablabel''gtl' GUI: custom label foratab page'guitabtooltip''gtt' GUI: custom tooltip foratab page'helpfile''hf' full path name of the mainhelp file'helpheight''hh' minimum height ofa newhelpwindow'helplang''hlg' preferredhelp languages'hidden''hid' don't unload buffer whenitisabandoned'highlight''hl' sets highlighting mode forvarious occasions'history''hi' number of command-lines that are remembered'hkmap''hk' Hebrew keyboardmapping'hkmapp''hkp' phonetic Hebrew keyboardmapping'hlsearch''hls' highlight matches with last searchpattern'icon' let Vim set the text of thewindow icon'iconstring'string to use for the Vim icon text'ignorecase''ic' ignorecase in search patterns'imactivatefunc''imaf' function to enable/disable theX inputmethod'imactivatekey''imak' key that activates theX inputmethod'imcmdline''imc' use IM whenstarting to edita command line'imdisable''imd'do not use the IM in any mode'iminsert''imi' use:lmap or IM inInsert mode'imsearch''ims' use:lmap or IM when typinga searchpattern'imstatusfunc''imsf' function to obtainX inputmethod status'imstyle''imst'specifies the input style of the inputmethod'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 searchpattern'indentexpr''inde'expression used to obtain the indent ofa line'indentkeys''indk' keys that trigger indenting with'indentexpr''infercase''inf' adjustcase of match for keyword completion'insertmode''im' start the edit ofa file inInsert 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 aftera period witha join command'jumpoptions''jop'specifies how jumpingis done'key'encryption key'keymap''kmp' name ofa keyboardmapping'keymodel''km' enable starting/stopping selection with keys'keyprotocol''kpc' what keyboard protocol to use for whatterminal'keywordprg''kp' program to use for the "K" command'langmap''lmap' alphabetic characters for other language mode'langmenu''lm' language to be used for themenus'langnoremap''lnr'do not apply'langmap' to mapped characters'langremap''lrm'do apply'langmap' to mapped characters'laststatus''ls' tells when lastwindow has status lines'lazyredraw''lz' don't redraw while executing macros'lhistory''lhi' maximum number of location lists inhistory'linebreak''lbr' wrap long linesata 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 indentingis done'lispwords''lw' words that change how lisp indenting works'list' show<Tab> and<EOL>'listchars''lcs' characters for displaying inlist mode'loadplugins''lpl' loadplugin scripts whenstarting up'luadll' name of theLua dynamic library'macatsui'Mac GUI: use ATSUI text drawing'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 ofa second to show matching paren'maxcombine''mco' maximum nr of combining characters displayed'maxfuncdepth''mfd' maximum recursive depth for userfunctions'maxmapdepth''mmd' maximum recursive depth formapping'maxmem''mm' maximum memory (in Kbyte) used for one buffer'maxmempattern''mmp' maximum memory (in Kbyte) used forpattern search'maxmemtot''mmt' maximum memory (in Kbyte) used for allbuffers'menuitems''mis' maximum number of items ina menu'mkspellmem''msm' memory used before:mkspell compresses the tree'modeline''ml' recognize modelinesat start orend of file'modelineexpr''mle' allow settingexpressionoptions fromamodeline'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 screenis 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>'mouseshape''mouses' shape of the mouse pointer in different modes'mousetime''mouset' max time between mousedouble-click'mzquantum''mzq' the interval between polls forMzScheme threads'mzschemedll' name of theMzScheme dynamic library'mzschemegcdll' name of theMzScheme dynamic library for GC'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 onMS-Windows'operatorfunc''opfunc' function to be called forg@operator'osfiletype''oft' no longer supported'packpath''pp'list of directories used forpackages'paragraphs''para' nroff macros that separate paragraphs'paste' allow pasting text'pastetoggle''pt' key code that causes'paste' totoggle'patchexpr''pex'expression used to patcha file'patchmode''pm' keep the oldest version ofa file'path''pa'list of directories searched with "gf" et.al.'perldll' name of thePerl dynamic library'preserveindent''pi' preserve the indent structure when reindenting'previewheight''pvh' height of the previewwindow'previewpopup''pvp' usepopupwindow for preview'previewwindow''pvw' identifies the previewwindow'printdevice''pdev' name of the printer to be used for:hardcopy'printencoding''penc' encoding to be used forprinting'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'printmbcharset''pmbcs' CJK character set to be used for:hardcopy'printmbfont''pmbfn' font names to be used for CJK output of:hardcopy'printoptions''popt' controls the format of:hardcopy output'prompt''prompt' enable prompt inEx mode'pumheight''ph' maximum height of thepopup menu'pumwidth''pw' minimum width of thepopup menu'pythondll' name of thePython 2 dynamic library'pythonhome' name of thePython 2home directory'pythonthreedll' name of thePython 3 dynamic library'pythonthreehome' name of thePython 3home directory'pyxversion''pyx'Python version used for pyx* commands'quickfixtextfunc''qftf' function for the text in thequickfixwindow'quoteescape''qe'escape characters used inastring'readonly''ro' disallowwriting the buffer'redrawtime''rdt' timeout for'hlsearch' and:match highlighting'regexpengine''re' defaultregexp engine to use'relativenumber''rnu' show relative line number in front of each line'remap' allow mappings to work recursively'renderoptions''rop'options for text rendering on Windows'report' threshold for reporting nr. of lines changed'restorescreen''rs' Win32: restore screen whenexiting'revins''ri'inserting characters will work backwards'rightleft''rl'windowis right-to-left oriented'rightleftcmd''rlc' commands for which editing works right-to-left'rubydll' name of theRuby dynamic library'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 inwindowas otherwindows scroll'scrollfocus''scf' scroll wheel applies towindow under pointer'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 useSelect mode instead ofVisual 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 toput output of ":make" in error file'shellquote''shq'quote character(s) for around shell command'shellredir''srr'string toput output offilter ina temp file'shellslash''ssl' use forward slash for shell file names'shelltemp''stmp' whether to usea temp file for shell commands'shelltype''st' Amiga: influences how to usea shell'shellxescape''sxe' characters toescape 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 ofmessages'shortname''sn' Filenames assumed to be 8.3 chars'showbreak''sbr'string to useat the start of wrapped lines'showcmd''sc' show (partial) command somewhere'showcmdloc''sloc' where to show (partial) command'showfulltag''sft' show fulltagpattern when completingtag'showmatch''sm' briefly jump to matching bracket ifinsert one'showmode''smd' message on status line to show current mode'showtabline''stal' tells when thetab pages lineis 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 to display the sign column'smartcase''scs' no ignorecase whenpattern hasuppercase'smartindent''si' smart autoindenting forC programs'smarttab''sta'<Tab> in leadingwhitespace indents by'shiftwidth''smoothscroll''sms' scroll by screen lines when'wrap'is set'softtabstop''sts' number of columns between two softtab stops'spell' enablespell checking'spellcapcheck''spc'pattern to locateend ofasentence'spellfile''spf' files wherezg andzw store words'spelllang''spl' language(s) todospell checking for'spelloptions''spo'options forspell checking'spellsuggest''sps' method(s) used to suggest spelling corrections'splitbelow''sb' newwindow from splitis below the current one'splitkeep''spk' determines scroll behavior for splitwindows'splitright''spr' newwindowisput right of the current one'startofline''sol' commands move cursor to first non-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 fora file'swapfile''swf' whether to usea swapfile fora buffer'swapsync''sws' how to sync the swap file'switchbuf''swb' sets behavior when switching to another buffer'synmaxcol''smc' maximum column to findsyntax items'syntax''syn'syntax to be loaded for current buffer'tabclose''tcl' whichtab page to focus when closingatab'tabline''tal' custom format for the consoletab pages line'tabpagemax''tpm' maximum number oftab pages for-p and "tab all"'tabstop''ts' number of columns between twotab stops'tagbsearch''tbs' use binary searching intags files'tagcase''tc' how to handlecase when searching intags files'tagfunc''tfu' function to getlist oftag matches'taglength''tl' number of significant characters foratag'tagrelative''tr' file names intag file are relative'tags''tag'list of file names used by thetag command'tagstack''tgst' pushtags onto thetag stack'tcldll' name of theTcl dynamic library'term' name of theterminal'termbidi''tbidi'terminal takes care of bi-directionality'termencoding''tenc' character encoding used by theterminal'termguicolors''tgc' useGUI colors for theterminal'termwinkey''twk' key that precedesa Vim command inaterminal'termwinscroll''twsl' max number of scrollback lines inaterminalwindow'termwinsize''tws' size ofaterminalwindow'termwintype''twt' MS-Windows: type of pty to use forterminalwindow'terse' shorten somemessages'textauto''ta' obsolete, use'fileformats''textmode''tx' obsolete, use'fileformat''textwidth''tw' maximum width of text thatis 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 anoperator'timeout''to' time out on mappings and key codes'timeoutlen''tm' time out time in milliseconds'title' let Vim set the title of thewindow'titlelen' percentage of'columns' used forwindow title'titleold' old title, restored whenexiting'titlestring'string to use for the Vimwindow title'toolbar''tb' GUI: which items to show in the toolbar'toolbariconsize''tbis' size of the toolbar icons (forGTK 2 only)'ttimeout' time out on mappings'ttimeoutlen''ttm' time out time for key codes in milliseconds'ttybuiltin''tbi' use built-intermcap before externaltermcap'ttyfast''tf' indicatesa fastterminal connection'ttymouse''ttym' type of mouse codes generated'ttyscroll''tsl' maximum number of lines fora scroll'ttytype''tty' alias for'term''undodir''udir' where to storeundo files'undofile''udf' saveundo information ina file'undolevels''ul' maximum number of changes that can be undone'undoreload''ur' max nr of lines to save forundo ona bufferreload'updatecount''uc' after this many characters flush swap file'updatetime''ut' after this many milliseconds flush swap file'varsofttabstop''vsts'alist of number of columns between softtab stops'vartabstop''vts'alist of number of columns betweentab stops'verbose''vbs' give informativemessages'verbosefile''vfile' file to writemessages in'viewdir''vdir' directory where to store files with:mkview'viewoptions''vop'specifies what to save for:mkview'viminfo''vi' use .viminfo file uponstartup andexiting'viminfofile''vif' file name used for theviminfo file'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''wiv' for terminals that have weird inversionmethod'whichwrap''ww' allow specified keys to cross line boundaries'wildchar''wc' command-line character forwildcard expansion'wildcharm''wcm' like'wildchar' but also works when mapped'wildignore''wig' files matching these patterns are not completed'wildignorecase''wic' ignorecase 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 completionis done'winaltkeys''wak' when thewindows system handles ALT keys'wincolor''wcr' window-local highlighting'window''wi' nr of lines to scroll forCTRL-F andCTRL-B'winfixbuf''wfb' keepwindow focused ona single buffer'winfixheight''wfh' keepwindow height when opening/closingwindows'winfixwidth''wfw' keepwindow width when opening/closingwindows'winheight''wh' minimum number of lines for the currentwindow'winminheight''wmh' minimum number of lines for anywindow'winminwidth''wmw' minimal number of columns for anywindow'winptydll' name of the winpty dynamic library'winwidth''wiw' minimal number of columns for currentwindow'wlseat''wse' the Wayland seat to use'wlsteal''wst' allow focus stealing functionality for Wayland'wltimeoutlen''wtm' timeout to use when polling in Wayland'wrap' long lines wrap and continue on the next line'wrapmargin''wm' chars from the right where wrapping starts'wrapscan''ws' searches wrap around theend of the file'write'writing toa fileis allowed'writeany''wa' write to file with no need for "!" override'writebackup''wb' makeabackup before overwritinga file'writedelay''wd' delay this many msec for each char (for debug)'xtermcodes' requestterminal codes from an xterm------------------------------------------------------------------------------Q_ur Undo/Redo commandsuNuundo lastN changesCTRL-RNCTRL-Rredo lastN undone changesUU restore last changed line------------------------------------------------------------------------------Q_et External commands:shell :sh[ell]starta shell:! :!{command}execute{command} witha shellKKlookup keyword under the cursor with'keywordprg' program (default: "man")------------------------------------------------------------------------------Q_qfQuickfix commands:cc:cc[nr]display error[nr] (defaultis the same again):cnext:cndisplay the next error:cprevious:cpdisplay the previous error:clist:cllist allerrors:cfile:cfreaderrors 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:caddfadderrors from the error file to the currentquickfixlist:caddexpr:cadadderrors from anexpression to the currentquickfixlist:cbuffer:cbreaderrors from text ina buffer:cexpr:cexreaderrors from anexpression:cquit:cqquit withoutwriting 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 commandsCTRL-LCTRL-Lclear and redraw the screenCTRL-GCTRL-Gshow current file name (with path) and cursor positiongagashow ascii value of character under cursor in decimal, hex, andoctalg8g8forutf-8 encoding: show byte sequence for character under cursor in hexg_CTRL-GgCTRL-Gshow cursor column, line, and character positionCTRL-CCTRL-Cduring searches: Interrupt the searchdos-CTRL-BreakCTRL-Break MS-Windows: during searches: Interrupt the search<Del><Del>while enteringa count: delete last character:version :ve[rsion]show version information:mode:modeNset screen mode toN (obsolete):normal :norm[al][!]{commands}executeNormal mode commandsQQswitch to "Ex" mode:redir:redir >{file}redirectmessages 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, usingafile selectiondialog------------------------------------------------------------------------------Q_ceCommand-line editingc_<Esc><Esc>abandon command-line (if'wildchar'is<Esc>, typeit 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} enterdigraph (SeeQ_di)c_CTRL-RCTRL-R{register}insert the contents ofa registerc_<Left><Left>/<Right> cursor left/rightc_<S-Left><S-Left>/<S-Right> cursor oneword left/rightc_CTRL-BCTRL-B/CTRL-E cursor to beginning/end of command-linec_<BS><BS> delete the character in front of the cursorc_<Del><Del> delete the character under the cursorc_CTRL-WCTRL-W delete theword in front of the cursorc_CTRL-UCTRL-U remove all charactersc_<Up><Up>/<Down> recall older/newer command-line that starts with current commandc_<S-Up><S-Up>/<S-Down> recall older/newer command-line fromhistoryc_CTRL-GCTRL-G next match when'incsearch'is activec_CTRL-TCTRL-T previous match when'incsearch'is active:history :his[tory] show older command-linesContext-sensitive completion on the command-line:c_wildchar'wildchar' (default:<Tab>)do completion on thepattern 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 thepattern in front of the cursorc_CTRL-ACTRL-Ainsert all names that matchpattern in front of cursorc_CTRL-LCTRL-Linsert longest common part of names that matchpatternc_CTRL-NCTRL-Nafter'wildchar' with multiple matches:go to next matchc_CTRL-PCTRL-Pafter'wildchar' with multiple matches:go to previous match------------------------------------------------------------------------------Q_raEx 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 ofmarkt: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_exSpecialEx characters:bar | separates two commands (not for ":global" and ":!"):quote " begins comment:_%% current file name (only wherea file nameis expected):_# #[num] alternate file name[num] (only wherea file nameis expected)Note: The next seven are typed literally; these are not special keys!:<abuf><abuf> buffer number, for use in anautocommand (only wherea file nameis expected):<afile><afile> file name, for use in anautocommand (only wherea file nameis expected):<amatch><amatch> what matched with the pattern, for use in anautocommand (only wherea file nameis expected):<cword><cword>word under the cursor (only wherea file nameis expected):<cWORD><cWORD>WORD under the cursor (only wherea file nameis expected) (seeWORD):<cfile><cfile> file name under the cursor (only wherea file nameis expected):<sfile><sfile> file name ofa ":source"d file, within that file (only wherea file nameis expected)After "%", "#", "<cfile>", "<sfile>" 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-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 errorMost useful Vim arguments (for fulllist seestartup-options)-gui-g startGUI (also allows other options)-+ +[num]put the cursorat line[num] (default: last line)-+c +{command} execute{command} after loading the file-+/ +/{pat}{file} ..put the cursorat the first occurrence of{pat}-v-vVi mode, startex inNormal mode-e-eEx mode, start vim inEx mode-R-R Read-only mode, implies-n-m-m modifications not allowed (resets'write' option)-d-ddiff modediff-b-b binary mode-l-l lisp mode-A-AArabic mode ('arabic'is set)-F-FFarsi mode ('fkmap' and'rightleft' are set)-H-H Hebrew mode ('hkmap' and'rightleft' are set)-V-V Verbose, give informativemessages-C-C Compatible, set the'compatible' option-N-N Nocompatible, reset the'compatible' option-r-r givelist of swap files-r-r{file} .. recover aborted edit session-n-ndo not createa swap file-o-o[num] open[num]windows (default: one for each file)-f-f GUI: foreground process, don'tfork Amiga:do not restart Vim to openawindow (fore.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} setterminal name-d-d{device} Amiga: open{device} to be usedasa console-u-u{vimrc} read inits from{vimrc} instead of other inits-U-U{gvimrc} idem, for whenstarting theGUI-i-i{viminfo} read info from{viminfo} instead of other files-----end of options, other arguments are file names--help--help showlist of arguments and exit--version--version show version info and exit--- read file from stdin------------------------------------------------------------------------------Q_ed Editinga 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][!] edita new, unnamed buffer:find :fin[d][!]{file} find{file} in'path' and edititCTRL-^NCTRL-^ edit alternate fileN (equivalent to ":e #N")gfgf or]f edit the file whose nameis 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------------------------------------------------------------------------------Q_fl Using the argumentlistargument-list:args :ar[gs]print the argument list, with the current file in "[]":all:all or:sallopenawindow for every file in the arglist: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 fileN:next :n[ext] :sn[ext]edit next file:next_f :n[ext]{arglist} :sn[ext]{arglist}define new arglist 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}, unlessit 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] linesas standard input:up :[range]up[date][!]write to current file if modified:wall :wa[ll][!]write all changedbuffers:q :q[uit]quit current buffer, unless changes have been made; Exit Vim when there are no other non-helpbuffers:q :q[uit]!quit current buffer always,discard any changes. Exit Vim when there are no other non-helpbuffers:qa :qa[ll]exit Vim, unless changes have been made:qa :qa[ll]!exit Vim always,discard any changes:cq:cqquit withoutwriting 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 madeZZZZsameas ":x"ZQZQsameas ":q!":xall :xa[ll][!] or :wqall[!]write all changedbuffers and exit:stop :st[op][!]suspend Vim or start new shell; if'aw' optionis set and [!] not given write the bufferCTRL-ZCTRL-Z sameas ":stop"------------------------------------------------------------------------------Q_ac Automatic Commandsviminfo-file read registers, marks,historyat startup, save when exiting.:rviminfo :rv[iminfo][file]read info fromviminfo file[file]:rviminfo :rv[iminfo]![file]idem, overwrite existing info:wviminfo :wv[iminfo][file]add info toviminfo file[file]:wviminfo :wv[iminfo]![file]write info toviminfo file[file]modeline Automatic option setting when editinga filemodeline vim:{set-arg}: ..In the first and last lines of thefile (see'ml' option),{set-arg}isgivenas an argument to ":set"autocommand Automatic execution of commands on certain events.:autocmd:aulist allautocommands:autocmd:au{event}list allautocommands for{event}:autocmd:au{event}{pat}list allautocommands for{event} with{pat}:autocmd:au{event}{pat}{cmd} enter newautocommands for{event} with{pat}:autocmd :au! remove allautocommands:autocmd :au!{event} remove allautocommands for{event}:autocmd :au! *{pat} remove allautocommands for{pat}:autocmd :au!{event}{pat} remove allautocommands for{event} with{pat}:autocmd :au!{event}{pat}{cmd} remove allautocommands for{event} with{pat} and enter new one------------------------------------------------------------------------------Q_wi Multi-window commandsCTRL-W_sCTRL-Ws or:splitsplitwindow into two parts:split_f:split{file}splitwindow 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 editit:terminal:terminal{cmd}openaterminalwindowCTRL-W_]CTRL-W]splitwindow and jump totag under cursorCTRL-W_fCTRL-Wfsplitwindow and edit file name under the cursorCTRL-W_^CTRL-W^splitwindow and edit alternate fileCTRL-W_nCTRL-Wn or:newcreate new emptywindowCTRL-W_qCTRL-Wq or :q[uit]quit editing and closewindowCTRL-W_cCTRL-Wc or :clo[se]make buffer hidden and closewindowCTRL-W_oCTRL-Wo or :on[ly]make currentwindow only one on the screenCTRL-W_jCTRL-Wjmove cursor towindow belowCTRL-W_kCTRL-Wkmove cursor towindow aboveCTRL-W_CTRL-WCTRL-WCTRL-Wmove cursor towindow below (wrap)CTRL-W_WCTRL-WWmove cursor towindow above (wrap)CTRL-W_tCTRL-Wtmove cursor to topwindowCTRL-W_bCTRL-Wbmove cursor to bottomwindowCTRL-W_pCTRL-Wpmove cursor to previous activewindowCTRL-W_rCTRL-Wrrotatewindows downwardsCTRL-W_RCTRL-WRrotatewindows upwardsCTRL-W_xCTRL-Wxexchange currentwindow with next oneCTRL-W_=CTRL-W=make allwindows equal height& widthCTRL-W_-CTRL-W-decrease currentwindow heightCTRL-W_+CTRL-W+increase currentwindow heightCTRL-W__CTRL-W_set currentwindow height (default: very high)CTRL-W_<CTRL-W<decrease currentwindow widthCTRL-W_>CTRL-W>increase currentwindow widthCTRL-W_barCTRL-W |set currentwindow width (default: widest possible)------------------------------------------------------------------------------Q_bu Bufferlist commands:buffers:buffers or:fileslist all known buffer and file names:ball:ball or:sballedit all args/buffers:unhide:unhide or:sunhideedit all loadedbuffers:badd:badd{fname}add file name{fname} to thelist:bunload :bunload[!] [N]unload buffer [N] from memory:bdelete :bdelete[!] [N]unload buffer [N] and deleteit from the bufferlistin current window in new window:buffer :[N]buffer [N] :[N]sbuffer [N] to arg/bufN: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_sySyntax Highlighting:syn-on:syntax onstart usingsyntax highlighting:syn-off:syntax offstop usingsyntax highlighting:syn-keyword:syntax keyword{group-name}{keyword} ..addasyntax keyword item:syn-match:syntax match{group-name}{pattern}...addsyntax match item:syn-region:syntax region{group-name}{pattern}...addsyntax region item:syn-sync:syntax sync [ccomment | lines{N} | ...]tellsyntax how to sync:syntax:syntax[list]list currentsyntax items:syn-clear:syntax clearclear allsyntax 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:filetypeplugin indent onswitch on file type detection, withautomatic indenting and settings------------------------------------------------------------------------------Q_guGUI commands:gui:guiUNIX: start theGUI:gui:gui{fname} ..idem, and edit{fname} ..:menu:menulist allmenus:menu:menu{mpath}listmenusstarting 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_foFolding'foldmethod'set foldmethod=manualmanualfoldingset foldmethod=indentfolding by indentset foldmethod=exprfolding by'foldexpr'set foldmethod=syntaxfolding bysyntax regionsset foldmethod=markerfolding by'foldmarker'zf zf{motion}operator: Definea fold manually:fold :{range}folddefinea fold for{range} lineszdzddelete one fold under the cursorzDzDdelete allfolds under the cursorzozoopen one fold under the cursorzOzOopen allfolds under the cursorzczcclose one fold under the cursorzCzCclose allfolds under the cursorzmzmfold more: decrease'foldlevel'zMzMclose all folds: make'foldlevel' zerozrzrreduce folding: increase'foldlevel'zRzRopen all folds: make'foldlevel' max.znznfold none: reset'foldenable'zNzNfold normal set'foldenable'ziziinvert'foldenable' vim:tw=78:ts=8:noet:ft=help:norl: