Normal Mode
203Every normal-mode command, from index.txt
CTRL-Aadd N to number at/after cursorCTRL-Bscroll N screens BackwardsCTRL-Cinterrupt current (search) commandCTRL-Dscroll Down N lines (default: half a screen)CTRL-Escroll N lines upwards (N lines Extra)CTRL-Fscroll N screens ForwardCTRL-Gdisplay current file name and position<BS>same as "h"CTRL-Hsame as "h"<Tab>go to N newer entry in jump listCTRL-Isame as <Tab><NL>same as "j"<S-NL>same as CTRL-FCTRL-Jsame as "j" CTRL-K not usedCTRL-Lredraw screen<CR>cursor to the first CHAR N lines lower<S-CR>same as CTRL-FCTRL-Msame as <CR>CTRL-Nsame as "j"CTRL-Ogo to N older entry in jump listCTRL-Psame as "k" CTRL-Q not used, or used for terminal control flowCTRL-Rredo changes which were undone with 'u' CTRL-S not used, or used for terminal control flowCTRL-Tjump to N older Tag in tag listCTRL-Uscroll N lines Upwards (default: half a screen)CTRL-Vstart blockwise Visual modeCTRL-W {char}window commands, see |CTRL-W|CTRL-Xsubtract N from number at/after cursorCTRL-Yscroll N lines downwardsCTRL-Zsuspend program (or start new shell) CTRL-[ <Esc> not usedCTRL-\ CTRL-Ngo to Normal mode (no-op)CTRL-\ CTRL-Ggo to mode specified with 'insertmode' CTRL-\ a - z reserved for extensions CTRL-\ others not usedCTRL-]:ta to ident under cursorCTRL-^edit Nth alternate file (equivalent to ":e #N") CTRL-_ not used<Space>same as "l" 2 filter Nmove text through the {filter} command!!{filter}filter N lines through the {filter} command"{register}use {register} for next delete, yank or put ({.%#:} only work with put)#search backward for the Nth occurrence of the ident under the cursor$cursor to the end of Nth next line%find the next (curly/square) bracket on this line and go to its match, or go to matching comment bracket, or go to matching preprocessor directive.{count}%go to N percentage in the file&repeat last :s'{a-zA-Z0-9}cursor to the first CHAR on the line with mark {a-zA-Z0-9}''cursor to the first CHAR of the line where the cursor was before the latest jump.'(cursor to the first CHAR on the line of the start of the current sentence')cursor to the first CHAR on the line of the end of the current sentence'<cursor to the first CHAR of the line where highlighted area starts/started in the current buffer.'>cursor to the first CHAR of the line where highlighted area ends/ended in the current buffer.'[cursor to the first CHAR on the line of the start of last operated text or start of put text']cursor to the first CHAR on the line of the end of last operated text or end of put text'{cursor to the first CHAR on the line of the start of the current paragraph'}cursor to the first CHAR on the line of the end of the current paragraph(cursor N sentences backward)cursor N sentences forward*search forward for the Nth occurrence of the ident under the cursor+same as <CR><S-+>same as CTRL-F,repeat latest f, t, F or T in opposite direction N times-cursor to the first CHAR N lines higher<S-->same as CTRL-B.repeat last change with count replaced with N/{pattern}<CR>search forward for the Nth occurrence of {pattern}/<CR>search forward for {pattern} of last search0cursor to the first char of the line1prepend to command to give a count2"3"4"5"6"7"8"9":start entering an Ex command{count}:start entering an Ex command with range from current line to N-1 lines down;repeat latest f, t, F or T N times<{motion}shift Nmove lines one 'shiftwidth' leftwards<<shift N lines one 'shiftwidth' leftwards={motion}filter Nmove lines through "indent"==filter N lines through "indent">{motion}shift Nmove lines one 'shiftwidth' rightwards>>shift N lines one 'shiftwidth' rightwards?{pattern}<CR>search backward for the Nth previous occurrence of {pattern}?<CR>search backward for {pattern} of last search@{a-z}execute the contents of register {a-z} N times@:repeat the previous ":" command N times@@repeat the previous @{a-z} N timesAappend text after the end of the line N timesBcursor N WORDS backward["x]Cchange from the cursor position to the end of the line, and N-1 more lines [into register x]; synonym for "c$"["x]Ddelete the characters under the cursor until the end of the line and N-1 more lines [into register x]; synonym for "d$"Ecursor forward to the end of WORD NF{char}cursor to the Nth occurrence of {char} to the leftGcursor to line N, default last lineHcursor to line N from top of screenIinsert text before the first CHAR on the line N timesJJoin N lines; default is 2Klookup Keyword under the cursor with 'keywordprg'Lcursor to line N from bottom of screenMcursor to middle line of screenNrepeat the latest '/' or '?' N times in opposite directionObegin a new line above the cursor and insert text, repeat N times["x]Pput the text [from register x] before the cursor N timesQswitch to "Ex" modeRenter replace mode: overtype existing characters, repeat the entered text N-1 times["x]Sdelete N lines [into register x] and start insert; synonym for "cc".T{char}cursor till after Nth occurrence of {char} to the leftUundo all latest changes on one lineVstart linewise Visual modeWcursor N WORDS forward["x]Xdelete N characters before the cursor [into register x]["x]Yyank N lines [into register x]; synonym for "yy"ZZwrite if buffer changed and close windowZQclose window without writing[{char}square bracket command (see |[| below) \ not used]{char}square bracket command (see |]| below)^cursor to the first CHAR of the line_cursor to the first CHAR N - 1 lines lower`{a-zA-Z0-9}cursor to the mark {a-zA-Z0-9}`(cursor to the start of the current sentence`)cursor to the end of the current sentence`<cursor to the start of the highlighted area`>cursor to the end of the highlighted area`[cursor to the start of last operated text or start of putted text`]cursor to the end of last operated text or end of putted text``cursor to the position before latest jump`{cursor to the start of the current paragraph`}cursor to the end of the current paragraphaappend text after the cursor N timesbcursor N words backward["x]c{motion}delete Nmove text [into register x] and start insert["x]ccdelete N lines [into register x] and start insert["x]d{motion}delete Nmove text [into register x]["x]dddelete N lines [into register x]dosame as ":diffget"dpsame as ":diffput"ecursor forward to the end of word Nf{char}cursor to Nth occurrence of {char} to the rightg{char}extended commands, see |g| belowhcursor N chars to the leftiinsert text before the cursor N timesjcursor N lines downwardkcursor N lines upwardlcursor N chars to the rightm{A-Za-z}set mark {A-Za-z} at cursor positionnrepeat the latest '/' or '?' N timesobegin a new line below the cursor and insert text, repeat N times["x]pput the text [from register x] after the cursor N timesq{0-9a-zA-Z"}record typed characters into named register {0-9a-zA-Z"} (uppercase to append)q(while recording) stops recordingq:edit : command-line in command-line windowq/edit / command-line in command-line windowq?edit ? command-line in command-line windowr{char}replace N chars with {char}["x]s(substitute) delete N characters [into register x] and start insertt{char}cursor till before Nth occurrence of {char} to the rightuundo changesvstart characterwise Visual modewcursor N words forward["x]xdelete N characters under and after the cursor [into register x]["x]y{motion}yank Nmove text [into register x]["x]yyyank N lines [into register x]z{char}commands starting with 'z', see |z| below{cursor N paragraphs backward|cursor to column N}cursor N paragraphs forward~'tildeop' off: switch case of N characters under cursor and move the cursor N characters to the right~{motion}'tildeop' on: switch case of Nmove text<C-End>same as "G"<C-Home>same as "gg"<C-Left>same as "b"<C-LeftMouse>":ta" to the keyword at the mouse click<C-Right>same as "w"<C-Tab>same as "g<Tab>"["x]<Del>same as "x"{count}<Del>remove the last digit from {count}<Down>same as "j"<End>same as "$"<F1>same as <Help><Help>open a help window<Home>same as "0"<Insert>same as "i"<Left>same as "h"<LeftMouse>move cursor to the mouse click position<MiddleMouse>same as "gP" at the mouse click position<PageDown>same as CTRL-F<PageUp>same as CTRL-B<Right>same as "l"<RightMouse>start Visual mode, move cursor to the mouse click position<S-Down>same as CTRL-F<S-Left>same as "b"<S-LeftMouse>same as "*" at the mouse click position<S-Right>same as "w"<S-Up>same as CTRL-B<Undo>same as "u"<Up>same as "k"<ScrollWheelDown>move window three lines down<S-ScrollWheelDown>move window one page down<ScrollWheelUp>move window three lines up<S-ScrollWheelUp>move window one page up<ScrollWheelLeft>move window six columns left<S-ScrollWheelLeft>move window one page left<ScrollWheelRight>move window six columns right<S-ScrollWheelRight>move window one page rightText Objects & Operators
39Text objects — after an operator or in visual mode
a"double quoted stringa'single quoted stringa(same as aba)same as aba<"a <>" from '<' to the matching '>'a>same as a<aB"a Block" from "[{" to "]}" (with brackets)aW"a WORD" (with white space)a["a []" from '[' to the matching ']'a]same as a[a`string in backticksab"a block" from "[(" to "])" (with braces)ap"a paragraph" (with white space)as"a sentence" (with white space)at"a tag block" (with white space)aw"a word" (with white space)a{same as aBa}same as aBi"double quoted string without the quotesi'single quoted string without the quotesi(same as ibi)same as ibi<"inner <>" from '<' to the matching '>'i>same as i<iB"inner Block" from "[{" and "]}"iW"inner WORD"i["inner []" from '[' to the matching ']'i]same as i[i`string in backticks without the backticksib"inner block" from "[(" to "])"ip"inner paragraph"is"inner sentence"it"inner tag block"iw"inner word"i{same as iBi}same as iBOperator-pending forcing
vforce operator to work characterwiseVforce operator to work linewiseCTRL-Vforce operator to work blockwiseInsert Mode
87Insert and replace mode
CTRL-@insert previously inserted text and stop insertCTRL-Ainsert previously inserted text CTRL-B not used |i_CTRL-B-gone|CTRL-Cquit insert mode, without checking for abbreviation, unless 'insertmode' set.CTRL-Ddelete one shiftwidth of indent in the current lineCTRL-Einsert the character which is below the cursor CTRL-F not used (but by default it's in 'cinkeys' to re-indent the current line)CTRL-G CTRL-Jline down, to column where inserting startedCTRL-G jline down, to column where inserting startedCTRL-G <Down>line down, to column where inserting startedCTRL-G CTRL-Kline up, to column where inserting startedCTRL-G kline up, to column where inserting startedCTRL-G <Up>line up, to column where inserting startedCTRL-G ustart new undoable editCTRL-G Udon't break undo with next cursor movement<BS>delete character before the cursor enter digraph (only when 'digraph' option set)CTRL-Hsame as <BS><Tab>insert a <Tab> characterCTRL-Isame as <Tab><NL>same as <CR>CTRL-Jsame as <CR> enter digraphCTRL-Lwhen 'insertmode' set: Leave Insert mode<CR>begin new lineCTRL-Msame as <CR>CTRL-Nfind next match for keyword in front of the cursorCTRL-Oexecute a single command and return to insert modeCTRL-Pfind previous match for keyword in front of the cursorCTRL-Qsame as CTRL-V, unless used for terminal control flow like CTRL-Q unless |modifyOtherKeys| is active insert the contents of a register insert the contents of a register literally insert the contents of a register literally and don't auto-indent insert the contents of a register literally and fix indent. CTRL-S not used or used for terminal control flowCTRL-Tinsert one shiftwidth of indent in current lineCTRL-Udelete all entered characters in the current lineCTRL-V {char}insert next non-digit literally like CTRL-V unless |modifyOtherKeys| is active byte.CTRL-Wdelete word before the cursorCTRL-X {mode}enter CTRL-X sub mode, see |i_CTRL-X_index|CTRL-Yinsert the character which is above the cursorCTRL-Zwhen 'insertmode' set: suspend Vim<Esc>end insert mode (unless 'insertmode' set)CTRL-[same as <Esc> CTRL-\ a - z reserved for extensions CTRL-\ others not usedCTRL-]trigger abbreviationCTRL-^toggle use of |:lmap| mappingsCTRL-_When 'allowrevins' set: change language (Hebrew, Farsi) {only when compiled with the |+rightleft| feature} <Space> to '~' not used, except '0' and '^' followed by CTRL-D0 CTRL-Ddelete all indent in the current line^ CTRL-Ddelete all indent in the current line, restore it in the next line<Del>delete character under the cursor Meta characters (0x80 to 0xff, 128 to 255) not used<Left>cursor one character left<S-Left>cursor one word left<C-Left>cursor one word left<Right>cursor one character right<S-Right>cursor one word right<C-Right>cursor one word right<Up>cursor one line up<S-Up>same as <PageUp><Down>cursor one line down<S-Down>same as <PageDown><Home>cursor to start of line<C-Home>cursor to start of file<End>cursor past end of line<C-End>cursor past end of file<PageUp>one screenful backward<PageDown>one screenful forward<F1>same as <Help><Help>stop insert mode and display help window<Insert>toggle Insert/Replace mode<LeftMouse>cursor at mouse click<ScrollWheelDown>move window three lines down<S-ScrollWheelDown>move window one page down<ScrollWheelUp>move window three lines up<S-ScrollWheelUp>move window one page up<ScrollWheelLeft>move window six columns left<S-ScrollWheelLeft>move window one page left<ScrollWheelRight>move window six columns rightcommands in CTRL-X submode*i_CTRL-X_index*CTRL-X CTRL-Dcomplete defined identifiersCTRL-X CTRL-Escroll upCTRL-X CTRL-Fcomplete file namesCTRL-X CTRL-Icomplete identifiersCTRL-X CTRL-Kcomplete identifiers from dictionaryCTRL-X CTRL-Lcomplete whole linesCTRL-X CTRL-Nnext completionCTRL-X CTRL-Oomni completionCTRL-X CTRL-Pprevious completionCTRL-X CTRL-Rcomplete contents from registersCTRL-X CTRL-Sspelling suggestionsCTRL-X CTRL-Tcomplete identifiers from thesaurusCTRL-X CTRL-Yscroll downCTRL-X CTRL-Ucomplete with 'completefunc'CTRL-X CTRL-Vcomplete like in : command lineCTRL-X CTRL-Zstop completion, keeping the text as-isCTRL-X CTRL-]complete tagsCTRL-X sspelling suggestions CTRL-L insert one character from the current match <CR> insert currently selected match <BS> delete one character and redo search CTRL-H same as <BS> <Up> select the previous match <Down> select the next match <PageUp> select a match several entries back <PageDown> select a match several entries forward other stop completion and insert the typed characterVisual & Select Mode
81Where visual differs from normal
CTRL-Aadd N to number in highlighted textCTRL-Cstop Visual modeCTRL-Gtoggle between Visual mode and Select mode<BS>Select mode: delete highlighted areaCTRL-Hsame as <BS>CTRL-Oswitch from Select to Visual mode for one commandCTRL-Vmake Visual mode blockwise or stop Visual modeCTRL-Xsubtract N from number in highlighted text<Esc>stop Visual modeCTRL-]jump to highlighted tag!{filter}filter the highlighted lines through the external command {filter}:start a command-line with the highlighted lines as a range<shift the highlighted lines one 'shiftwidth' left=filter the highlighted lines through the external program given with the 'equalprg' option>shift the highlighted lines one 'shiftwidth' rightAblock mode: append same text in all lines, after the highlighted areaCdelete the highlighted lines and start insertDdelete the highlighted linesIblock mode: insert same text in all lines, before the highlighted areaJjoin the highlighted linesKrun 'keywordprg' on the highlighted areaOmove horizontally to other corner of areaPreplace highlighted area with register contents; registers are unchanged Q does not start Ex modeRdelete the highlighted lines and start insertSdelete the highlighted lines and start insertUmake highlighted area uppercaseVmake Visual mode linewise or stop Visual modeXdelete the highlighted linesYyank the highlighted linesa"extend highlighted area with a double quoted stringa'extend highlighted area with a single quoted stringa(same as aba)same as aba<extend highlighted area with a <> blocka>same as a<aBextend highlighted area with a {} blockaWextend highlighted area with "a WORD"a[extend highlighted area with a [] blocka]same as a[a`extend highlighted area with a backtick quoted stringabextend highlighted area with a () blockapextend highlighted area with a paragraphasextend highlighted area with a sentenceatextend highlighted area with a tag blockawextend highlighted area with "a word"a{same as aBa}same as aBcdelete highlighted area and start insertddelete highlighted areag CTRL-Aadd N to number in highlighted textg CTRL-Xsubtract N from number in highlighted textgJjoin the highlighted lines without inserting spacesgqformat the highlighted linesgvexchange current and previous highlighted areai"extend highlighted area with a double quoted string (without quotes)i'extend highlighted area with a single quoted string (without quotes)i(same as ibi)same as ibi<extend highlighted area with inner <> blocki>same as i<iBextend highlighted area with inner {} blockiWextend highlighted area with "inner WORD"i[extend highlighted area with inner [] blocki]same as i[i`extend highlighted area with a backtick quoted string (without the backticks)ibextend highlighted area with inner () blockipextend highlighted area with inner paragraphisextend highlighted area with inner sentenceitextend highlighted area with inner tag blockiwextend highlighted area with "inner word"i{same as iBi}same as iBomove cursor to other corner of areapreplace highlighted area with register contents; deleted text in unnamed registerrreplace highlighted area with a charactersdelete highlighted area and start insertumake highlighted area lowercasevmake Visual mode characterwise or stop Visual modexdelete the highlighted areayyank the highlighted area~swap case for the highlighted areaWindow Commands
74CTRL-W — splits, sizes and movement
CTRL-W CTRL-Bsame as "CTRL-W b"CTRL-W CTRL-Cno-opCTRL-W CTRL-Dsame as "CTRL-W d"CTRL-W CTRL-Fsame as "CTRL-W f" CTRL-W CTRL-G same as "CTRL-W g .."CTRL-W CTRL-Hsame as "CTRL-W h"CTRL-W CTRL-Isame as "CTRL-W i"CTRL-W CTRL-Jsame as "CTRL-W j"CTRL-W CTRL-Ksame as "CTRL-W k"CTRL-W CTRL-Lsame as "CTRL-W l"CTRL-W CTRL-Nsame as "CTRL-W n"CTRL-W CTRL-Osame as "CTRL-W o"CTRL-W CTRL-Psame as "CTRL-W p"CTRL-W CTRL-Qsame as "CTRL-W q"CTRL-W CTRL-Rsame as "CTRL-W r"CTRL-W CTRL-Ssame as "CTRL-W s"CTRL-W CTRL-Tsame as "CTRL-W t"CTRL-W CTRL-Vsame as "CTRL-W v"CTRL-W CTRL-Wsame as "CTRL-W w"CTRL-W CTRL-Xsame as "CTRL-W x"CTRL-W CTRL-Zsame as "CTRL-W z"CTRL-W CTRL-]same as "CTRL-W ]"CTRL-W CTRL-^same as "CTRL-W ^"CTRL-W CTRL-_same as "CTRL-W _"CTRL-W +increase current window height N linesCTRL-W -decrease current window height N linesCTRL-W :same as |:|, edit a command lineCTRL-W <decrease current window width N columnsCTRL-W =make all windows the same height & widthCTRL-W >increase current window width N columnsCTRL-W Hmove current window to the far leftCTRL-W Jmove current window to the very bottomCTRL-W Kmove current window to the very topCTRL-W Lmove current window to the far rightCTRL-W Pgo to preview windowCTRL-W Rrotate windows upwards N timesCTRL-W Ssame as "CTRL-W s"CTRL-W Tmove current window to a new tab pageCTRL-W Wgo to N previous window (wrap around)CTRL-W ]split window and jump to tag under cursorCTRL-W ^split current window and edit alternate file NCTRL-W _set current window height to N (default: very high)CTRL-W bgo to bottom windowCTRL-W cclose current window (like |:close|)CTRL-W dsplit window and jump to definition under the cursorCTRL-W fsplit window and edit file name under the cursorCTRL-W Fsplit window and edit file name under the cursor and jump to the line number following the file name. cursorCTRL-W g ]split window and do |:tselect| for tag under cursorCTRL-W g }do a |:ptjump| to the tag under the cursorCTRL-W g fedit file name under the cursor in a new tab pageCTRL-W g Fedit file name under the cursor in a new tab page and jump to the line number following the file name.CTRL-W g tsame as `gt`: go to next tab pageCTRL-W g Tsame as `gT`: go to previous tab pageCTRL-W g <Tab>same as |g<Tab>|: go to last accessed tab page.CTRL-W hgo to Nth left window (stop at first window)CTRL-W isplit window and jump to declaration of identifier under the cursorCTRL-W jgo N windows down (stop at last window)CTRL-W kgo N windows up (stop at first window)CTRL-W lgo to Nth right window (stop at last window)CTRL-W nopen new window, N lines highCTRL-W oclose all but current window (like |:only|)CTRL-W pgo to previous (last accessed) windowCTRL-W qquit current window (like |:quit|)CTRL-W rrotate windows downwards N timesCTRL-W ssplit current window in two parts, new window N lines highCTRL-W tgo to top windowCTRL-W vsplit current window vertically, new window N columns wideCTRL-W wgo to N next window (wrap around)CTRL-W xexchange current window with window N (default: next window)CTRL-W zclose preview windowCTRL-W |set window width to N columnsCTRL-W }show tag under cursor in preview windowCTRL-W <Down>same as "CTRL-W j"CTRL-W <Up>same as "CTRL-W k"CTRL-W <Left>same as "CTRL-W h"Bracket Commands
44[ and ] — unmatched pairs, includes, diffs, spelling
[ CTRL-Djump to first #define found in current and included files matching the word under the cursor, start searching at beginning of current file[ CTRL-Ijump to first line in current and included files that contains the word under the cursor, start searching at beginning of current file[#cursor to N previous unmatched #if, #else or #ifdef['cursor to previous lowercase mark, on first non-blank[(cursor N times back to unmatched '('[*same as "[/"[`cursor to previous lowercase mark[/cursor to N previous start of a C comment[Dlist all defines found in current and included files matching the word under the cursor, start searching at beginning of current file[Ilist all lines found in current and included files that contain the word under the cursor, start searching at beginning of current file[Psame as "[p"[[cursor N sections backward[]cursor N SECTIONS backward[ccursor N times backwards to start of change[dshow first #define found in current and included files matching the word under the cursor, start searching at beginning of current file[fsame as "gf"[ishow first line found in current and included files that contains the word under the cursor, start searching at beginning of current file[mcursor N times back to start of member function[plike "P", but adjust indent to current line[smove to the previous misspelled word[zmove to start of open fold[{cursor N times back to unmatched '{'] CTRL-Djump to first #define found in current and included files matching the word under the cursor, start searching at cursor position] CTRL-Ijump to first line in current and included files that contains the word under the cursor, start searching at cursor position]#cursor to N next unmatched #endif or #else]'cursor to next lowercase mark, on first non-blank])cursor N times forward to unmatched ')']*same as "]/"]`cursor to next lowercase mark]/cursor to N next end of a C comment]Dlist all #defines found in current and included files matching the word under the cursor, start searching at cursor position]Ilist all lines found in current and included files that contain the word under the cursor, start searching at cursor position]Psame as "[p"][cursor N SECTIONS forward]]cursor N sections forward]ccursor N times forward to start of change]dshow first #define found in current and included files matching the word under the cursor, start searching at cursor position]fsame as "gf"]ishow first line found in current and included files that contains the word under the cursor, start searching at cursor position]mcursor N times forward to end of member function]plike "p", but adjust indent to current line]smove to next misspelled word]zmove to end of open fold]}cursor N times forward to unmatched '}'g Commands
66The second normal-mode namespace
g CTRL-Aonly when compiled with MEM_PROFILE defined: dump a memory profileg CTRL-Gshow information about current cursor positiong CTRL-Hstart Select block modeg CTRL-]|:tjump| to the tag under the cursorg#like "#", but without using "\<" and "\>"g$when 'wrap' off go to rightmost character of the current line that is on the screen; when 'wrap' on go to the rightmost character of the current screen lineg&repeat last ":s" on all linesg'{mark}like |'| but without changing the jumplistg`{mark}like |`| but without changing the jumplistg*like "*", but without using "\<" and "\>"g+go to newer text state N timesg,go to N newer position in change listg-go to older text state N timesg0when 'wrap' off go to leftmost character of the current line that is on the screen; when 'wrap' on go to the leftmost character of the current screen lineg8print hex value of bytes used in UTF-8 character under the cursorg;go to N older position in change listg<display previous command outputg?Rot13 encoding operatorg??Rot13 encode current lineg?g?Rot13 encode current linegDgo to definition of word under the cursor in current filegEgo backwards to the end of the previous WORDgHstart Select line modegIlike "I", but always start in column 1gJjoin lines without inserting spacegN1,2 find the previous match with the last used search pattern and Visually select it["x]gPput the text [from register x] before the cursor N times, leave the cursor after itgQswitch to "Ex" mode with Vim editinggRenter Virtual Replace modegTgo to the previous tab pagegU{motion}make Nmove text uppercasegVdon't reselect the previous Visual area when executing a mapping or menu in Select modeg]:tselect on the tag under the cursorg^when 'wrap' off go to leftmost non-white character of the current line that is on the screen; when 'wrap' on go to the leftmost non-white character of the current screen lineg_cursor to the last CHAR N - 1 lines lowergaprint ascii value of character under the cursorgdgo to definition of word under the cursor in current functiongego backwards to the end of the previous wordgfstart editing the file whose name is under the cursorgFstart editing the file whose name is under the cursor and jump to the line number following the filename.ggcursor to line N, default first lineghstart Select modegilike "i", but first move to the |'^| markgjlike "j", but when 'wrap' on go N screen lines downgklike "k", but when 'wrap' on go N screen lines upgmgo to character at middle of the screenlinegMgo to character at middle of the text linegn1,2 find the next match with the last used search pattern and Visually select itgocursor to byte N in the buffer["x]gpput the text [from register x] after the cursor N times, leave the cursor after itgq{motion}format Nmove textgr{char}virtual replace N chars with {char}gsgo to sleep for N seconds (default 1)gtgo to the next tab pagegu{motion}make Nmove text lowercasegvreselect the previous Visual areagw{motion}format Nmove text and keep cursorg@{motion}call 'operatorfunc'g~{motion}swap case for Nmove textg<Down>same as "gj"g<End>same as "g$"g<Home>same as "g0"g<LeftMouse>same as <C-LeftMouse> g<MiddleMouse> same as <C-MiddleMouse>g<RightMouse>same as <C-RightMouse>g<Tab>go to the last accessed tab page.g<Up>same as "gk"z Commands
52Scrolling, folding and spelling
z<CR>redraw, cursor line to top of window, cursor on first non-blankz{height}<CR>redraw, make window {height} lines highz+cursor on line N (default line below window), otherwise like "z<CR>"z-redraw, cursor line at bottom of window, cursor on first non-blankz.redraw, cursor line to center of window, cursor on first non-blankz=give spelling suggestionszAopen a closed fold or close an open fold recursivelyzCclose folds recursivelyzDdelete folds recursivelyzEeliminate all foldszFcreate a fold for N lineszGtemporarily mark word as correctly spelledzHwhen 'wrap' off scroll half a screenwidth to the rightzLwhen 'wrap' off scroll half a screenwidth to the leftzMset 'foldlevel' to zerozNset 'foldenable'zOopen folds recursivelyzRset 'foldlevel' to the deepest foldzWtemporarily mark word as incorrectly spelledzXre-apply 'foldlevel'z^cursor on line N (default line above window), otherwise like "z-"zaopen a closed fold, close an open foldzbredraw, cursor line at bottom of windowzcclose a foldzddelete a foldzewhen 'wrap' off scroll horizontally to position the cursor at the end (right side) of the screenzf{motion}create a fold for Nmove textzgpermanently mark word as correctly spelledzhwhen 'wrap' off scroll screen N characters to the rightzitoggle 'foldenable'zjmove to the start of the next foldzkmove to the end of the previous foldzlwhen 'wrap' off scroll screen N characters to the leftzmsubtract one from 'foldlevel'znreset 'foldenable'zoopen foldzppaste in block-mode without trailing spaceszPpaste in block-mode without trailing spaceszradd one to 'foldlevel'zswhen 'wrap' off scroll horizontally to position the cursor at the start (left side) of the screenztredraw, cursor line at top of windowzuwundo |zw|zugundo |zg|zuWundo |zW|zuGundo |zG|zvopen enough folds to view the cursor linezwpermanently mark word as incorrectly spelledzxre-apply 'foldlevel' and do "zv"zyyank without trailing spaceszzredraw, cursor line at center of windowz<Left>same as "zh"z<Right>same as "zl"Command Line & Terminal
53Command-line editing
CTRL-Ado completion on the pattern in front of the cursor and insert all matchesCTRL-Bcursor to begin of command-lineCTRL-Csame as <Esc>CTRL-Dlist completions that match the pattern in front of the cursorCTRL-Ecursor to end of command-line'cedit'CTRL-F default value for 'cedit': opens the command-line window; otherwise not usedCTRL-Gnext match when 'incsearch' is active<BS>delete the character in front of the cursor enter digraph when 'digraph' is onCTRL-Hsame as <BS><Tab>if 'wildchar' is <Tab>: Do completion on the pattern in front of the cursor<S-Tab>same as CTRL-P'wildchar'Do completion on the pattern in front of the cursor (default: <Tab>)CTRL-Isame as <Tab><NL>same as <CR>CTRL-Jsame as <CR> enter digraphCTRL-Ldo completion on the pattern in front of the cursor and insert the longest common part<CR>execute entered commandCTRL-Msame as <CR>CTRL-Nafter using 'wildchar' with multiple matches: go to next match, otherwise: recall older command-line from history. CTRL-O not usedCTRL-Pafter using 'wildchar' with multiple matches: go to previous match, otherwise: recall older command-line from history.CTRL-Qsame as CTRL-V, unless it's used for terminal control flow insert the contents of a register or object under the cursor as if typed insert the contents of a register or object under the cursor literally CTRL-S not used, or used for terminal control flowCTRL-Tprevious match when 'incsearch' is activeCTRL-Uremove all charactersCTRL-Vinsert next non-digit literally, insert three digit decimal number as a single byte.CTRL-Wdelete the word in front of the cursor CTRL-X not used (reserved for completion) CTRL-Y copy (yank) modeless selection CTRL-Z not used (reserved for suspend)<Esc>abandon command-line without executing itCTRL-[same as <Esc> abandon command-line CTRL-\ a - d reserved for extensions {expr} CTRL-\ f - z reserved for extensions CTRL-\ others not usedCTRL-]trigger abbreviationCTRL-^toggle use of |:lmap| mappingsCTRL-_when 'allowrevins' set: change language (Hebrew, Farsi)<Del>delete the character under the cursor<Left>cursor left<S-Left>cursor one word left<C-Left>cursor one word left<Right>cursor right<S-Right>cursor one word right<C-Right>cursor one word right<Up>recall previous command-line from history that matches pattern in front of the cursor<S-Up>recall previous command-line from history<Down>recall next command-line from history that matches pattern in front of the cursor<S-Down>recall next command-line from history<Home>cursor to start of command-line<End>cursor to end of command-line<PageDown>same as <S-Down><PageUp>same as <S-Up><Insert>toggle insert/overstrike mode<LeftMouse>cursor at mouse click <Up> move up to parent / select the previous match <Down> move down to submenu / select the next match <Left> select the previous match / move up to parent <Right> select the next match / move down to submenu <CR> move into submenu when doing menu completion CTRL-E stop completion and go back to original text CTRL-Y accept selected match and stop completion other stop completion and insert the typed character <PageUp> select a match several entries back <PageDown> select a match several entries forwardTerminal-Job mode
CTRL-W Nswitch to Terminal-Normal modeCTRL-W :enter an Ex commandCTRL-W .type CTRL-W in the terminal CTRL-W CTRL-\ send a CTRL-\ to the job in the terminal paste register in the terminalCTRL-W gtgo to next tabpage, same as `gt`CTRL-W gTgo to previous tabpage, same as `gT`You found it, Arthur!*holy-grail* *:smile*Registers, Marks & Ranges
49Registers
"a – "znamed registers; you fill them"A – "Zappend to the matching lowercase register""the unnamed register — last delete or yank"0the yank register — last y only"1 – "9delete ring; "1 is the newest multi-line delete"-small delete register: deletes of less than one line"_the black hole — write only"+the system clipboard (CLIPBOARD selection)"*the X11 primary selection (middle-click); same as "+ on Windows/macOS"%name of the current file"#name of the alternate file".the last inserted text":the last command line"/the last search pattern"=the expression register:reg[isters] [x]show register contentslet @a = "text"set a register from scriptq{reg} … qrecord keystrokes into a register@{reg} / @@replay a register / replay the last replayed:@aexecute register a as ex commandsMarks and jumps
m{a-zA-Z}set a mark; lowercase = file-local, uppercase = global`a / 'ato mark a, exact position / first non-blank of its line`` / ''to the position before the last jump`.to the position of the last change`^to where insert mode was last left`[ / `]start / end of the last changed or yanked text`< / `>start / end of the last visual selection`"position when the file was last exited:markslist all marks:delm[arks] a b / :delm!delete marks / all lowercase marksCTRL-O / CTRL-Iolder / newer position in the jump listEx ranges and the two commands worth memorising
{n}line n; 0 means "before the first line".the current line$the last line of the file%the whole file — shorthand for 1,$*the last visual selection — same as '<,'>'xthe line of mark x/pat/ / ?pat?next / previous line matching pat\/ / \?next / previous line matching the last search pattern+n / -nn lines after / before the preceding address;separator that moves the cursor to the first address first:{range}norm[al] {keys}run normal-mode keys on every line in the range:g/pat/{cmd}run cmd on every line matching pat:v/pat/{cmd} / :g!run cmd on every line NOT matching pat:g/pat/d _delete matching lines into the black hole:{range}t {addr}copy the range to after addr (:co[py]):{range}m {addr}move the range to after addr:{range}!cmdfilter the range through an external command:r !cmd / :w !cmdread command output in / write range to a commandPatterns & Substitute
22Vim regex, offsets and :s
\vvery magic — almost PCRE: ( ) + ? { } | are special\m / \M / \Vmagic (default) / nomagic / very nomagic\< / \>start / end of word\zs / \zeset start / end of the match\@= \@! \@<= \@<!lookahead / negative / lookbehind / negative\%Vinside the visual selection\%d123 \%x7f \%u20acmatch a character by decimal, hex or Unicode value\%23l \%23c \%23vonly on line 23 / column 23 / virtual column 23\{n,m} \{-}count; \{-} is the non-greedy *\(...\) / \1capture group / backreference\%(...\)non-capturing group\i \k \f \p \s \d \x \o \w \h \a \l \ucharacter classes; uppercase negates[[:alpha:]]POSIX character classes inside []\c / \Cforce case-insensitive / case-sensitive for the whole pattern/pat/e /pat/s+2 /pat/;/pat2/search offsets and chained searches:s/pat/rep/[flags]substitute in the range& ~ \0 \1–\9in the replacement: whole match, previous replacement, groups\u \l \U \L \Ecase-fold the rest of the replacement\=exprthe replacement is a Vim expressiong c i I n e:s flags — all matches, confirm, ignore case, match case, count only, no error:%s//rep/gempty pattern reuses the last search:&& / g&repeat the last :s with its flags / on the whole fileEx Commands
599Every ":" command, sorted on the non-optional part of its name
:nothing:{range}go to last line in {range}:!filter lines or execute an external command:!!repeat last ":!" command:#same as ":number":&repeat last ":substitute":*use the last Visual area, like :'<,'>:<shift lines one 'shiftwidth' left:=print the last line number:>shift lines one 'shiftwidth' right:@execute contents of a register:@@repeat the previous ":@":2mat[ch]define a second match to highlight:3mat[ch]define a third match to highlight:N[ext]go to previous file in the argument list:P[rint]print lines:Xask for encryption key:a[ppend]append text:ab[breviate]enter abbreviation:abc[lear]remove all abbreviations:abo[veleft]make split window appear left or above:abstractdeclare a Vim9 abstract class:al[l]open a window for each file in the argument list:am[enu]enter new menu item for all modes:an[oremenu]enter a new menu for all modes that will not be remapped:ar[gs]print the argument list:arga[dd]add items to the argument list:argded[upe]remove duplicates from the argument list:argd[elete]delete items from the argument list:arge[dit]add item to the argument list and edit it:argdodo a command on all items in the argument list:argg[lobal]define the global argument list:argl[ocal]define a local argument list:argu[ment]go to specific file in the argument list:as[cii]print ascii value of character under the cursor:au[tocmd]enter or show autocommands:aug[roup]select the autocommand group to use:aun[menu]remove menu for all modes:b[uffer]go to specific buffer in the buffer list:bN[ext]go to previous buffer in the buffer list:ba[ll]open a window for each buffer in the buffer list:bad[d]add buffer to the buffer list:baltlike ":badd" but also set the alternate file:bd[elete]remove a buffer from the buffer list:be[have]set mouse and selection behavior:bel[owright]make split window appear right or below:bf[irst]go to first buffer in the buffer list:bl[ast]go to last buffer in the buffer list:bm[odified]go to next buffer in the buffer list that has been modified:bn[ext]go to next buffer in the buffer list:bo[tright]make split window appear at bottom or far right:bp[revious]go to previous buffer in the buffer list:br[ewind]go to first buffer in the buffer list:brea[k]break out of while loop:breaka[dd]add a debugger breakpoint:breakd[el]delete a debugger breakpoint:breakl[ist]list debugger breakpoints:bro[wse]use file selection dialog:bufd[o]execute command in each listed buffer:bufferslist all files in the buffer list:bun[load]unload a specific buffer:bw[ipeout]really delete a buffer:c[hange]replace a line or series of lines:cN[ext]go to previous error:cNf[ile]go to last error in previous file:ca[bbrev]like ":abbreviate" but for Command-line mode:cabc[lear]clear all abbreviations for Command-line mode:cabo[ve]go to error above current line:cad[dbuffer]add errors from buffer:cadde[xpr]add errors from expr:caddf[ile]add error message to current quickfix list:caf[ter]go to error after current cursor:cal[l]call a function:cat[ch]part of a :try command:cbe[fore]go to error before current cursor:cbel[ow]go to error below current line:cbo[ttom]scroll to the bottom of the quickfix window:cb[uffer]parse error messages and jump to first error:ccgo to specific error:ccl[ose]close quickfix window:cdchange directory:cdoexecute command in each valid error list entry:cfd[o]execute command in each file in error list:ce[nter]format lines at the center:cex[pr]read errors from expr and jump to first:cf[ile]read file with error messages and jump to first:cfir[st]go to the specified error, default first one:cgetb[uffer]get errors from buffer:cgete[xpr]get errors from expr:cg[etfile]read file with error messages:changesprint the change list:chd[ir]change directory:che[ckpath]list included files:checkt[ime]check timestamp of loaded buffers:chi[story]list the error lists:classstart of a class declaration:cla[st]go to the specified error, default last one:cle[arjumps]clear the jump list:clip[reset]reset 'clipmethod':cl[ist]list all errors:clo[se]close current window:cm[ap]like ":map" but for Command-line mode:cmapc[lear]clear all mappings for Command-line mode:cme[nu]add menu for Command-line mode:cn[ext]go to next error:cnew[er]go to newer error list:cnf[ile]go to first error in next file:cno[remap]like ":noremap" but for Command-line mode:cnorea[bbrev]like ":noreabbrev" but for Command-line mode:cnoreme[nu]like ":noremenu" but for Command-line mode:co[py]copy lines:col[der]go to older error list:colo[rscheme]load a specific color scheme:com[mand]create user-defined command:comc[lear]clear all user-defined commands:comp[iler]do settings for a specific compiler:con[tinue]go back to :while:conf[irm]prompt user when confirmation required:cons[t]create a variable as a constant:cope[n]open quickfix window:cp[revious]go to previous error:cpf[ile]go to last error in previous file:cq[uit]quit Vim with an error code:cr[ewind]go to the specified error, default first one:cs[cope]execute cscope command:cst[ag]use cscope to jump to a tag:cu[nmap]like ":unmap" but for Command-line mode:cuna[bbrev]like ":unabbrev" but for Command-line mode:cunme[nu]remove menu for Command-line mode:cw[indow]open or close quickfix window:d[elete]delete lines:deb[ug]run a command in debugging mode:debugg[reedy]read debug mode commands from normal input:defdefine a Vim9 user function:defc[ompile]compile Vim9 user functions in current script:defe[r]call function when current function is done:delc[ommand]delete user-defined command:delf[unction]delete a user function:delm[arks]delete marks:dif[fupdate]update 'diff' buffers:diffg[et]remove differences in current buffer:diffo[ff]switch off diff mode:diffp[atch]apply a patch and show differences:diffpu[t]remove differences in other buffer:diffs[plit]show differences with another file:difft[his]make current window a diff window:dig[raphs]show or enter digraphs:di[splay]display registers:disa[ssemble]disassemble Vim9 user function:dj[ump]jump to #define:dlshort for |:delete| with the 'l' flag:dli[st]list #defines:do[autocmd]apply autocommands to current buffer:doautoa[ll]apply autocommands for all loaded buffers:d[elete]pshort for |:delete| with the 'p' flag:dr[op]jump to window editing file or edit file in current window:ds[earch]list one #define:dsp[lit]split window and jump to #define:e[dit]edit a file:ea[rlier]go to older change, undo:ec[ho]echoes the result of expressions:echoc[onsole]like :echomsg but write to stdout:echoe[rr]like :echo, show like an error and use history:echoh[l]set highlighting for echo commands:echom[sg]same as :echo, put message in history:echonsame as :echo, but without <EOL>:echow[indow]same as :echomsg, but use a popup window:el[se]part of an :if command:elsei[f]part of an :if command:em[enu]execute a menu by name:endclassend of a class declaration:enddefend of a user function started with :def:endenumend of an enum declaration:en[dif]end previous :if:endinterfaceend of an interface declaration:endfo[r]end previous :for:endf[unction]end of a user function started with :function:endt[ry]end previous :try:endw[hile]end previous :while:ene[w]edit a new, unnamed buffer:enumstart of an enum declaration:ev[al]evaluate an expression and discard the result:exsame as ":edit":exe[cute]execute result of expressions:exi[t]same as ":xit":exp[ort]Vim9: export an item from a script:exu[sage]overview of Ex commands:f[ile]show or set the current file name:fileslist all files in the buffer list:filet[ype]switch file type detection on/off:filt[er]filter output of following command:fin[d]find file in 'path' and edit it:finaldeclare an immutable variable in Vim9:fina[lly]part of a :try command:fini[sh]quit sourcing a Vim script:fir[st]go to the first file in the argument list:fix[del]set key code of <Del>:fo[ld]create a fold:foldc[lose]close folds:foldd[oopen]execute command on lines not in a closed fold:folddoc[losed]execute command on lines in a closed fold:foldo[pen]open folds:forfor loop:fu[nction]define a user function:g[lobal]execute commands for matching lines:go[to]go to byte in the buffer:gr[ep]run 'grepprg' and jump to first match:grepa[dd]like :grep, but append to current list:gu[i]start the GUI:gv[im]start the GUI:ha[rdcopy]send text to the printer:h[elp]open a help window:helpc[lose]close one help window:helpf[ind]dialog to open a help window:helpg[rep]like ":grep" but searches help files:helpt[ags]generate help tags for a directory:hi[ghlight]specify highlighting methods:hid[e]hide current buffer for a command:his[tory]print a history list:hor[izontal]following window command work horizontally:i[nsert]insert text:ia[bbrev]like ":abbrev" but for Insert mode:iabc[lear]like ":abclear" but for Insert mode:ifexecute commands when condition met:ij[ump]jump to definition of identifier:il[ist]list lines where identifier matches:im[ap]like ":map" but for Insert mode:imapc[lear]like ":mapclear" but for Insert mode:ime[nu]add menu for Insert mode:imp[ort]Vim9: import an item from another script:ino[remap]like ":noremap" but for Insert mode:inorea[bbrev]like ":noreabbrev" but for Insert mode:inoreme[nu]like ":noremenu" but for Insert mode:int[ro]print the introductory message:interfacestart of an interface declaration:ip[ut]like |:put|, but adjust the indent to the current line:is[earch]list one line where identifier matches:isp[lit]split window and jump to definition of identifier:iu[nmap]like ":unmap" but for Insert mode:iuna[bbrev]like ":unabbrev" but for Insert mode:iunme[nu]remove menu for Insert mode:j[oin]join lines:ju[mps]print the jump list:kset a mark:keepa[lt]following command keeps the alternate file:kee[pmarks]following command keeps marks where they are:keepj[umps]following command keeps jumplist and marks:keepp[atterns]following command keeps search pattern history:lN[ext]go to previous entry in location list:lNf[ile]go to last entry in previous file:l[ist]print lines:lab[ove]go to location above current line:lad[dexpr]add locations from expr:laddb[uffer]add locations from buffer:laddf[ile]add locations to current location list:laf[ter]go to location after current cursor:la[st]go to the last file in the argument list:lan[guage]set the language (locale):lat[er]go to newer change, redo:lbe[fore]go to location before current cursor:lbel[ow]go to location below current line:lbo[ttom]scroll to the bottom of the location window:lb[uffer]parse locations and jump to first location:lc[d]change directory locally:lch[dir]change directory locally:lcl[ose]close location window:lcs[cope]like ":cscope" but uses location list:ld[o]execute command in valid location list entries:lfd[o]execute command in each file in location list:le[ft]left align lines:lefta[bove]make split window appear left or above:leg[acy]make following command use legacy script syntax:letassign a value to a variable or option:lex[pr]read locations from expr and jump to first:lf[ile]read file with locations and jump to first:lfir[st]go to the specified location, default first one:lgetb[uffer]get locations from buffer:lgete[xpr]get locations from expr:lg[etfile]read file with locations:lgr[ep]run 'grepprg' and jump to first match:lgrepa[dd]like :grep, but append to current list:lh[elpgrep]like ":helpgrep" but uses location list:lhi[story]list the location lists:llgo to specific location:lla[st]go to the specified location, default last one:lli[st]list all locations:lmak[e]execute external command 'makeprg' and parse error messages:lm[ap]like ":map!" but includes Lang-Arg mode:lmapc[lear]like ":mapclear!" but includes Lang-Arg mode:lne[xt]go to next location:lnew[er]go to newer location list:lnf[ile]go to first location in next file:ln[oremap]like ":noremap!" but includes Lang-Arg mode:loadk[eymap]load the following keymaps until EOF:lo[adview]load view for current window from a file:loc[kmarks]following command keeps marks where they are:lockv[ar]lock variables:lol[der]go to older location list:lop[en]open location window:lp[revious]go to previous location:lpf[ile]go to last location in previous file:lr[ewind]go to the specified location, default first one:lslist all buffers:lt[ag]jump to tag and add matching tags to the location list:lu[nmap]like ":unmap!" but includes Lang-Arg mode:luaexecute |Lua| command:luad[o]execute Lua command for each line:luaf[ile]execute |Lua| script file:lv[imgrep]search for pattern in files:lvimgrepa[dd]like :vimgrep, but append to current list:lw[indow]open or close location window:m[ove]move lines:ma[rk]set a mark:mak[e]execute external command 'makeprg' and parse error messages:mapshow or enter a mapping:mapc[lear]clear all mappings for Normal and Visual mode:markslist all marks:mat[ch]define a match to highlight:me[nu]enter a new menu item:mes[sages]view previously displayed messages:mk[exrc]write current mappings and settings to a file:mks[ession]write session info to a file:mksp[ell]produce .spl spell file:mkv[imrc]write current mappings and settings to a file:mkvie[w]write view of current window to a file:mod[e]show or change the screen mode:mz[scheme]execute MzScheme command:mzf[ile]execute MzScheme script file:nbc[lose]close the current Netbeans session:nb[key]pass a key to Netbeans:nbs[tart]start a new Netbeans session:n[ext]go to next file in the argument list:newcreate a new empty window:nm[ap]like ":map" but for Normal mode:nmapc[lear]clear all mappings for Normal mode:nme[nu]add menu for Normal mode:nn[oremap]like ":noremap" but for Normal mode:nnoreme[nu]like ":noremenu" but for Normal mode:noa[utocmd]following commands don't trigger autocommands:no[remap]enter a mapping that will not be remapped:noh[lsearch]suspend 'hlsearch' highlighting:norea[bbrev]enter an abbreviation that will not be remapped:noreme[nu]enter a menu that will not be remapped:norm[al]execute Normal mode commands:nos[wapfile]following commands don't create a swap file:nu[mber]print lines with line number:nun[map]like ":unmap" but for Normal mode:nunme[nu]remove menu for Normal mode:ol[dfiles]list files that have marks in the viminfo file:o[pen]start open mode (not implemented):om[ap]like ":map" but for Operator-pending mode:omapc[lear]remove all mappings for Operator-pending mode:ome[nu]add menu for Operator-pending mode:on[ly]close all windows except the current one:ono[remap]like ":noremap" but for Operator-pending mode:onoreme[nu]like ":noremenu" but for Operator-pending mode:opt[ions]open the options-window:ou[nmap]like ":unmap" but for Operator-pending mode:ounme[nu]remove menu for Operator-pending mode:ow[nsyntax]set new local syntax highlight for this window:pa[ckadd]add a plugin from 'packpath':packl[oadall]load all packages under 'packpath':pb[uffer]edit buffer in the preview window:pc[lose]close preview window:ped[it]edit file in the preview window:pe[rl]execute Perl command:p[rint]print lines:profd[el]stop profiling a function or script:prof[ile]profiling functions and scripts:pro[mptfind]open GUI dialog for searching:promptr[epl]open GUI dialog for search/replace:perld[o]execute Perl command for each line:po[p]jump to older entry in tag stack:popu[p]popup a menu by name:pp[op]":pop" in preview window:pre[serve]write all text to swap file:prev[ious]go to previous file in argument list:ps[earch]like ":ijump" but shows match in preview window:pt[ag]show tag in preview window:ptN[ext]|:tNext| in preview window:ptf[irst]|:trewind| in preview window:ptj[ump]|:tjump| and show tag in preview window:ptl[ast]|:tlast| in preview window:ptn[ext]|:tnext| in preview window:ptp[revious]|:tprevious| in preview window:ptr[ewind]|:trewind| in preview window:pts[elect]|:tselect| and show tag in preview window:publicprefix for a class or object member:pu[t]insert contents of register in the text:pw[d]print current directory:py3execute Python 3 command:python3same as :py3:py3d[o]execute Python 3 command for each line:py3f[ile]execute Python 3 script file:py[thon]execute Python command:pyd[o]execute Python command for each line:pyf[ile]execute Python script file:pyxexecute |python_x| command:pythonxsame as :pyx:pyxd[o]execute |python_x| command for each line:pyxf[ile]execute |python_x| script file:q[uit]quit current window (when one window quit Vim):quita[ll]quit Vim:qa[ll]quit Vim:r[ead]read file into the text:rec[over]recover a file from a swap file:red[o]redo one undone change:redi[r]redirect messages to a file or register:redr[aw]force a redraw of the display:redraws[tatus]force a redraw of the status line(s):reg[isters]display the contents of registers:res[ize]change current window height:ret[ab]change tab size:retu[rn]return from a user function:rew[ind]go to the first file in the argument list:ri[ght]right align text:rightb[elow]make split window appear right or below:rub[y]execute Ruby command:rubyd[o]execute Ruby command for each line:rubyf[ile]execute Ruby script file:rund[o]read undo information from a file:ru[ntime]source vim scripts in 'runtimepath':rv[iminfo]read from viminfo file:s[ubstitute]find and replace text:sN[ext]split window and go to previous file in argument list:san[dbox]execute a command in the sandbox:sa[rgument]split window and go to specific file in argument list:sal[l]open a window for each file in argument list:sav[eas]save file under another name.:sb[uffer]split window and go to specific file in the buffer list:sbN[ext]split window and go to previous file in the buffer list:sba[ll]open a window for each file in the buffer list:sbf[irst]split window and go to first file in the buffer list:sbl[ast]split window and go to last file in buffer list:sbm[odified]split window and go to modified file in the buffer list:sbn[ext]split window and go to next file in the buffer list:sbp[revious]split window and go to previous file in the buffer list:sbr[ewind]split window and go to first file in the buffer list:scr[iptnames]list names of all sourced Vim scripts:scs[cope]split window and execute cscope command:se[t]show or set options:setf[iletype]set 'filetype', unless it was set already:setg[lobal]show global values of options:setl[ocal]show or set options locally:sf[ind]split current window and edit file in 'path':sfir[st]split window and go to first file in the argument list:sh[ell]escape to a shell:sim[alt]Win32 GUI: simulate Windows ALT key:sig[n]manipulate signs:sil[ent]run a command silently:sl[eep]do nothing for a few seconds:sl[eep]!do nothing for a few seconds, without the cursor visible:sla[st]split window and go to last file in the argument list:sm[agic]:substitute with 'magic':smaplike ":map" but for Select mode:smapc[lear]remove all mappings for Select mode:sme[nu]add menu for Select mode:smi[le]make the user happy:sn[ext]split window and go to next file in the argument list:sno[magic]:substitute with 'nomagic':snor[emap]like ":noremap" but for Select mode:snoreme[nu]like ":noremenu" but for Select mode:sor[t]sort lines:so[urce]read Vim or Ex commands from a file:spelld[ump]split window and fill with all correct words:spe[llgood]add good word for spelling:spelli[nfo]show info about loaded spell files:spellra[re]add rare word for spelling:spellr[epall]replace all bad words like last |z=|:spellu[ndo]remove good or bad word:spellw[rong]add spelling mistake:sp[lit]split current window:spr[evious]split window and go to previous file in the argument list:sre[wind]split window and go to first file in the argument list:st[op]suspend the editor or escape to a shell:sta[g]split window and jump to a tag:star[tinsert]start Insert mode:startr[eplace]start Replace mode:staticprefix for a class member or function:stopi[nsert]stop Insert mode:stj[ump]do ":tjump" and split window:sts[elect]do ":tselect" and split window:sun[hide]same as ":unhide":sunm[ap]like ":unmap" but for Select mode:sunme[nu]remove menu for Select mode:sus[pend]same as ":stop":sv[iew]split window and edit file read-only:sw[apname]show the name of the current swap file:sy[ntax]syntax highlighting:synti[me]measure syntax highlighting speed:sync[bind]sync scroll binding:tsame as ":copy":tN[ext]jump to previous matching tag:tabN[ext]go to previous tab page:tabc[lose]close current tab page:tabd[o]execute command in each tab page:tabe[dit]edit a file in a new tab page:tabf[ind]find file in 'path', edit it in a new tab page:tabfir[st]go to first tab page:tabl[ast]go to last tab page:tabm[ove]move tab page to other position:tabnewedit a file in a new tab page:tabn[ext]go to next tab page:tabo[nly]close all tab pages except the current one:tabp[revious]go to previous tab page:tabr[ewind]go to first tab page:tabslist the tab pages and what they contain:tabcreate new tab when opening new window:ta[g]jump to tag:tagsshow the contents of the tag stack:tc[d]change directory for tab page:tch[dir]change directory for tab page:tclexecute Tcl command:tcld[o]execute Tcl command for each line:tclf[ile]execute Tcl script file:te[aroff]tear-off a menu:ter[minal]open a terminal window:tf[irst]jump to first matching tag:th[row]throw an exception:thisprefix for an object member during initialization (e.g. on |new()|):tj[ump]like ":tselect", but jump directly when there is only one match:tl[ast]jump to last matching tag:tlm[enu]add menu for Terminal-Job mode:tln[oremenu]like ":noremenu" but for Terminal-Job mode:tlu[nmenu]remove menu for Terminal-Job mode:tmapc[lear]remove all mappings for Terminal-Job mode:tma[p]like ":map" but for Terminal-Job mode:tm[enu]define menu tooltip:tn[ext]jump to next matching tag:tno[remap]like ":noremap" but for Terminal-Job mode:to[pleft]make split window appear at top or far left:tp[revious]jump to previous matching tag:tr[ewind]jump to first matching tag:tryexecute commands, abort on error or exception:ts[elect]list matching tags and select one:tunma[p]like ":unmap" but for Terminal-Job mode:tu[nmenu]remove menu tooltip:typecreate a type alias:u[ndo]undo last change(s):undoj[oin]join next change with previous undo block:undol[ist]list leafs of the undo tree:una[bbreviate]remove abbreviation:unh[ide]open a window for each loaded file in the buffer list:uni[q]uniq lines:unl[et]delete variable:unlo[ckvar]unlock variables:unm[ap]remove mapping:unme[nu]remove menu:uns[ilent]run a command not silently:up[date]write buffer if modified:v[global]execute commands for not matching lines:varvariable declaration in Vim9:ve[rsion]print version number and other info:verb[ose]execute command with 'verbose' set:vert[ical]make following command split vertically:vim9[cmd]make following command use Vim9 script syntax:vim9s[cript]indicates Vim9 script file:vim[grep]search for pattern in files:vimgrepa[dd]like :vimgrep, but append to current list:vi[sual]same as ":edit", but turns off "Ex" mode:viu[sage]overview of Normal mode commands:vie[w]edit a file read-only:vm[ap]like ":map" but for Visual+Select mode:vmapc[lear]remove all mappings for Visual+Select mode:vme[nu]add menu for Visual+Select mode:vne[w]create a new empty window, vertically split:vn[oremap]like ":noremap" but for Visual+Select mode:vnoreme[nu]like ":noremenu" but for Visual+Select mode:vs[plit]split current window vertically:vu[nmap]like ":unmap" but for Visual+Select mode:vunme[nu]remove menu for Visual+Select mode:wind[o]execute command in each window:w[rite]write to a file:wN[ext]write to a file and go to previous file in argument list:wa[ll]write all (changed) buffers:wh[ile]execute loop for as long as condition met:wi[nsize]get or set window size (obsolete):winc[md]execute a Window (CTRL-W) command:winp[os]get or set window position:wl[restore]restore the Wayland compositor connection:wn[ext]write to a file and go to next file in argument list:wp[revious]write to a file and go to previous file in argument list:wqwrite to a file and quit window or Vim:wqa[ll]write all changed buffers and quit Vim:wu[ndo]write undo information to a file:wv[iminfo]write to viminfo file:x[it]write if buffer changed and close window:xa[ll]same as ":wqall":xmapc[lear]remove all mappings for Visual mode:xm[ap]like ":map" but for Visual mode:xme[nu]add menu for Visual mode:xr[estore]restores the X server connection:xn[oremap]like ":noremap" but for Visual mode:xnoreme[nu]like ":noremenu" but for Visual mode:xu[nmap]like ":unmap" but for Visual mode:xunme[nu]remove menu for Visual mode:y[ank]yank lines into a register:zprint some lines:~repeat last ":substitute" vim:tw=78:ts=8:noet:ft=help:norl:Options
436Every option and its abbreviation
'aleph' 'al'ASCII code of the letter Aleph (Hebrew)'allowrevins' 'ari'allow CTRL-_ in Insert and Command-line mode'altkeymap' 'akm'obsolete option for Farsi'ambiwidth' 'ambw'what to do with Unicode chars of ambiguous width'antialias' 'anti'Mac OS X: use smooth, antialiased fonts'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'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'how backspace works at start of line'backup' 'bk'keep backup file after overwriting a file'backupcopy' 'bkc'make backup as a copy, don't rename the file'backupdir' 'bdir'list of directories for the backup file'backupext' 'bex'extension used for the backup file'backupskip' 'bsk'no backup for files that match these patterns'balloondelay' 'bdlay'delay in mS before a balloon may pop up'ballooneval' 'beval'switch on balloon evaluation in the GUI'balloonevalterm' 'bevalterm'switch on balloon evaluation in the terminal'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'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'clipmethod' 'cpm'specify order of what clipboard methods to use'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'compatible' 'cp'behave Vi-compatible as much as possible'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'completepopup' 'cpp'options for the Insert mode completion info popup'completeslash' 'csl'like 'shellslash' for completion'completetimeout' 'cto'initial decay timeout for CTRL-N and CTRL-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'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 of encryption to use for file writing'cscopepathcomp' 'cspc'how many components of the path to show'cscopeprg' 'csprg'command to execute cscope'cscopequickfix' 'csqf'use quickfix window for cscope results'cscoperelative' 'csre'Use cscope.out path basename as prefix'cscopetag' 'cst'use cscope for tag commands'cscopetagorder' 'csto'determines ":cstag" search order'cscopeverbose' 'csverb'give messages when adding a cscope database'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'edcompatible' 'ed'toggle flags of ":substitute" command'emoji' 'emo'emoji characters are considered full width'encoding' 'enc'encoding used internally'endoffile' 'eof'write CTRL-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'esckeys' 'ek'recognize function keys in Insert mode'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 .vimrc and .exrc 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>'fkmap' 'fk'obsolete option for Farsi'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'guifontset' 'gfs'GUI: Names of multibyte fonts to be used'guifontwide' 'gfw'list of font names for double-wide characters'guiheadroom' 'ghr'GUI: pixels room for window decorations'guiligatures' 'gli'GTK GUI: ASCII characters that can form shapes'guioptions' 'go'GUI: Which components and options are used'guipty'GUI: try to use a pseudo-tty for ":!" commands'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 is |abandon|ed'highlight' 'hl'sets highlighting mode for various occasions'history' 'hi'number of command-lines that are remembered'hkmap' 'hk'Hebrew keyboard mapping'hkmapp' 'hkp'phonetic Hebrew keyboard mapping'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'imactivatefunc' 'imaf'function to enable/disable the X input method'imactivatekey' 'imak'key that activates the X input method'imcmdline' 'imc'use IM when starting to edit a command line'imdisable' 'imd'do not use the IM in any mode'iminsert' 'imi'use :lmap or IM in Insert mode'imsearch' 'ims'use :lmap or IM when typing a search pattern'imstatusfunc' 'imsf'function to obtain X input method status'imstyle' 'imst'specifies the input style of the input method'include' 'inc'pattern to be used to find an include file'includeexpr' 'inex'expression used to process an include line'incsearch' 'is'highlight match while typing search pattern'indentexpr' 'inde'expression used to obtain the indent of a line'indentkeys' 'indk'keys that trigger indenting with 'indentexpr''infercase' 'inf'adjust case of match for keyword completion'insertmode' 'im'start the edit of a file in Insert mode'isfname' 'isf'characters included in file names and pathnames'isident' 'isi'characters included in identifiers'iskeyword' 'isk'characters included in keywords'isprint' 'isp'printable characters'joinspaces' 'js'two spaces after a period with a join command'jumpoptions' 'jop'specifies how jumping is done'key'encryption key'keymap' 'kmp'name of a keyboard mapping'keymodel' 'km'enable starting/stopping selection with keys'keyprotocol' 'kpc'what keyboard protocol to use for what terminal'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'langnoremap' 'lnr'do not apply 'langmap' to mapped characters'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'luadll'name of the Lua 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 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'maxmem' 'mm'maximum memory (in Kbyte) used for one buffer'maxmempattern' 'mmp'maximum memory (in Kbyte) used for pattern search'maxmemtot' 'mmt'maximum memory (in Kbyte) used for all buffers'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>'mouseshape' 'mouses'shape of the mouse pointer in different modes'mousetime' 'mouset'max time between mouse double-click'mzquantum' 'mzq'the interval between polls for MzScheme threads'mzschemedll'name of the MzScheme dynamic library'mzschemegcdll'name of the MzScheme dynamic library for GC'nrformats' 'nf'number formats recognized for CTRL-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 for |g@| operator'osfiletype' 'oft'no longer supported'packpath' 'pp'list of directories used for packages'paragraphs' 'para'nroff macros that separate paragraphs'paste'allow pasting text'pastetoggle' 'pt'key code that causes 'paste' to toggle'patchexpr' 'pex'expression used to patch a file'patchmode' 'pm'keep the oldest version of a file'path' 'pa'list of directories searched with "gf" et.al.'perldll'name of the Perl dynamic library'preserveindent' 'pi'preserve the indent structure when reindenting'previewheight' 'pvh'height of the preview window'previewpopup' 'pvp'use popup window for preview'previewwindow' 'pvw'identifies the preview window'printdevice' 'pdev'name of the printer to be used for :hardcopy'printencoding' 'penc'encoding to be used for printing'printexpr' 'pexpr'expression used to print PostScript for :hardcopy'printfont' 'pfn'name of the font to be used for :hardcopy'printheader' 'pheader'format of the header used for :hardcopy'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 in Ex mode'pumheight' 'ph'maximum height of the popup menu'pumwidth' 'pw'minimum width of the popup menu'pythondll'name of the Python 2 dynamic library'pythonhome'name of the Python 2 home directory'pythonthreedll'name of the Python 3 dynamic library'pythonthreehome'name of the Python 3 home directory'pyxversion' 'pyx'Python version used for pyx* commands'quickfixtextfunc' 'qftf'function for the text in the quickfix window'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'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 when exiting'revins' 'ri'inserting characters will work backwards'rightleft' 'rl'window is right-to-left oriented'rightleftcmd' 'rlc'commands for which editing works right-to-left'rubydll'name of the Ruby 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 with CTRL-U and CTRL-D'scrollbind' 'scb'scroll in window as other windows scroll'scrollfocus' 'scf'scroll wheel applies to window 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 use Select mode instead of Visual mode'sessionoptions' 'ssop'options for |:mksession|'shell' 'sh'name of shell to use for external commands'shellcmdflag' 'shcf'flag to shell to execute one command'shellpipe' 'sp'string to put output of ":make" in error file'shellquote' 'shq'quote character(s) for around shell command'shellredir' 'srr'string to put output of filter in a temp file'shellslash' 'ssl'use forward slash for shell file names'shelltemp' 'stmp'whether to use a temp file for shell commands'shelltype' 'st'Amiga: influences how to use a shell'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'shortname' 'sn'Filenames assumed to be 8.3 chars'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 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 where |zg| and |zw| 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'statusline' 'stl'custom format for the status line'suffixes' 'su'suffixes that are ignored with multiple match'suffixesadd' 'sua'suffixes added when searching for a file'swapfile' 'swf'whether to use a swapfile for a buffer'swapsync' 'sws'how to sync the swap file'switchbuf' 'swb'sets behavior when switching to another buffer'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'tcldll'name of the Tcl dynamic library'term'name of the terminal'termbidi' 'tbidi'terminal takes care of bi-directionality'termencoding' 'tenc'character encoding used by the terminal'termguicolors' 'tgc'use GUI colors for the terminal'termwinkey' 'twk'key that precedes a Vim command in a terminal'termwinscroll' 'twsl'max number of scrollback lines in a terminal window'termwinsize' 'tws'size of a terminal window'termwintype' 'twt'MS-Windows: type of pty to use for terminal window'terse'shorten some messages'textauto' 'ta'obsolete, use 'fileformats''textmode' 'tx'obsolete, use 'fileformat''textwidth' 'tw'maximum width of text that is being inserted'thesaurus' 'tsr'list of thesaurus files for keyword completion'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'toolbar' 'tb'GUI: which items to show in the toolbar'toolbariconsize' 'tbis'size of the toolbar icons (for GTK 2 only)'ttimeout'time out on mappings'ttimeoutlen' 'ttm'time out time for key codes in milliseconds'ttybuiltin' 'tbi'use built-in termcap before external termcap'ttyfast' 'tf'indicates a fast terminal connection'ttymouse' 'ttym'type of mouse codes generated'ttyscroll' 'tsl'maximum number of lines for a scroll'ttytype' 'tty'alias for 'term''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'viminfo' 'vi'use .viminfo file upon startup and exiting'viminfofile' 'vif'file name used for the viminfo 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 inversion method'whichwrap' 'ww'allow specified keys to cross line boundaries'wildchar' 'wc'command-line character for wildcard expansion'wildcharm' 'wcm'like 'wildchar' but also works when mapped'wildignore' 'wig'files matching these patterns are not completed'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'wincolor' 'wcr'window-local highlighting'window' 'wi'nr of lines to scroll for CTRL-F and CTRL-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'winminheight' 'wmh'minimum number of lines for any window'winminwidth' 'wmw'minimal number of columns for any window'winptydll'name of the winpty dynamic library'winwidth' 'wiw'minimal number of columns for current window'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 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)'xtermcodes'request terminal codes from an xtermBuilt-in Functions
591Every function in builtin.txt, with its return type
abs({expr})Float or Number · absolute value of {expr}acos({expr})Float · arc cosine of {expr}add({object}, {item})List/Blob · append {item} to {object}and({expr}, {expr})Number · bitwise ANDappend({lnum}, {text})Number · append {text} below line {lnum}appendbufline({buf}, {lnum}, {text})Number · append {text} below line {lnum} in buffer {buf}argc([{winid}])Number · number of files in the argument listargidx()Number · current index in the argument listarglistid([{winnr} [, {tabnr}]])Number · argument list idargv({nr} [, {winid}])String · {nr} entry of the argument listargv([-1, {winid}])List · the argument listasin({expr})Float · arc sine of {expr}assert_beeps({cmd})Number · assert {cmd} causes a beepassert_equal({exp}, {act} [, {msg}])Number · assert {exp} is equal to {act}assert_equalfile({fname-one}, {fname-two} [, {msg}])Number · assert file contents are equalassert_exception({error} [, {msg}])Number · assert {error} is in v:exceptionassert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]])Number · assert {cmd} failsassert_false({actual} [, {msg}])Number · assert {actual} is falseassert_inrange({lower}, {upper}, {actual} [, {msg}])Number · assert {actual} is inside the rangeassert_match({pat}, {text} [, {msg}])Number · assert {pat} matches {text}assert_nobeep({cmd})Number · assert {cmd} does not cause a beepassert_notequal({exp}, {act} [, {msg}])Number · assert {exp} is not equal {act}assert_notmatch({pat}, {text} [, {msg}])Number · assert {pat} not matches {text}assert_report({msg})Number · report a test failureassert_true({actual} [, {msg}])Number · assert {actual} is trueatan({expr})Float · arc tangent of {expr}atan2({expr1}, {expr2})Float · arc tangent of {expr1} / {expr2}autocmd_add({acmds})Bool · add a list of autocmds and groupsautocmd_delete({acmds})Bool · delete a list of autocmds and groupsautocmd_get([{opts}])List · return a list of autocmdsballoon_gettext()String · current text in the balloonballoon_show({expr})none · show {expr} inside the balloonballoon_split({msg})List · split {msg} as used for a balloonbase64_decode({string})Blob · base64 decode {string} charactersbase64_encode({blob})String · base64 encode the bytes in {blob}bindtextdomain({package}, {path})Bool · bind text domain to specified pathblob2list({blob})List · convert {blob} into a list of numbersblob2str({blob} [, {options}])List · convert {blob} into a list of stringsbrowse({save}, {title}, {initdir}, {default})String · put up a file requesterbrowsedir({title}, {initdir})String · put up a directory requesterbufadd({name})Number · add a buffer to the buffer listbufexists({buf})Number · |TRUE| if buffer {buf} existsbuflisted({buf})Number · |TRUE| if buffer {buf} is listedbufload({buf})Number · load buffer {buf} if not loaded yetbufloaded({buf})Number · |TRUE| if buffer {buf} is loadedbufname([{buf}])String · Name of the buffer {buf}bufnr([{buf} [, {create}]])Number · Number of the buffer {buf}bufwinid({buf})Number · window ID of buffer {buf}bufwinnr({buf})Number · window number of buffer {buf}byte2line({byte})Number · line number at byte count {byte}byteidx({expr}, {nr} [, {utf16}])Number · byte index of {nr}'th char in {expr}byteidxcomp({expr}, {nr} [, {utf16}])Number · byte index of {nr}'th char in {expr}call({func}, {arglist} [, {dict}])any · call {func} with arguments {arglist}ceil({expr})Float · round {expr} upch_canread({handle})Number · check if there is something to readch_close({handle})none · close {handle}ch_close_in({handle})none · close in part of {handle}ch_evalexpr({handle}, {expr} [, {options}])any · evaluate {expr} on JSON {handle}ch_evalraw({handle}, {string} [, {options}])any · evaluate {string} on raw {handle}ch_getbufnr({handle}, {what})Number · get buffer number for {handle}/{what}ch_getjob({channel})Job · get the Job of {channel}ch_info({handle})String · info about channel {handle}ch_log({msg} [, {handle}])none · write {msg} in the channel log filech_logfile({fname} [, {mode}])none · start logging channel activitych_open({address} [, {options}])Channel · open a channel to {address}ch_read({handle} [, {options}])String · read from {handle}ch_readblob({handle} [, {options}])Blob · read Blob from {handle}ch_readraw({handle} [, {options}])String · read raw from {handle}ch_sendexpr({handle}, {expr} [, {options}])any · send {expr} over JSON {handle}ch_sendraw({handle}, {expr} [, {options}])any · send {expr} over raw {handle}ch_setoptions({handle}, {options})none · set options for {handle}ch_status({handle} [, {options}])String · status of channel {handle}changenr()Number · current change numberchar2nr({expr} [, {utf8}])Number · ASCII/UTF-8 value of first char in {expr}charclass({string})Number · character class of {string}charcol({expr} [, {winid}])Number · column number of cursor or markcharidx({string}, {idx} [, {countcc} [, {utf16}]])Number · char index of byte {idx} in {string}chdir({dir})String · change current working directorycindent({lnum})Number · C indent for line {lnum}clearmatches([{win}])none · clear all matchescmdcomplete_info()Dict · get current cmdline completion informationcol({expr} [, {winid}])Number · column byte index of cursor or markcomplete({startcol}, {matches})none · set Insert mode completioncomplete_add({expr})Number · add completion matchcomplete_check()Number · check for key typed during completioncomplete_info([{what}])Dict · get current completion informationcomplete_match([{lnum}, {col}])List · get completion column and trigger textconfirm({msg} [, {choices} [, {default} [, {type}]]])Number · number of choice picked by usercopy({expr})any · make a shallow copy of {expr}cos({expr})Float · cosine of {expr}cosh({expr})Float · hyperbolic cosine of {expr}count({comp}, {expr} [, {ic} [, {start}]])Number · count how many {expr} are in {comp}cscope_connection([{num}, {dbpath} [, {prepend}]])Number · checks existence of cscope connectioncursor({lnum}, {col} [, {off}])Number · move cursor to {lnum}, {col}, {off}cursor({list})Number · move cursor to position in {list}debugbreak({pid})Number · interrupt process being debuggeddeepcopy({expr} [, {noref}])any · make a full copy of {expr}delete({fname} [, {flags}])Number · delete the file or directory {fname}deletebufline({buf}, {first} [, {last}])Number · delete lines from buffer {buf}did_filetype()Number · |TRUE| if FileType autocmd event useddiff({fromlist}, {tolist} [, {options}])List · diff two Lists of stringsdiff_filler({lnum})Number · diff filler lines about {lnum}diff_hlID({lnum}, {col})Number · diff highlighting at {lnum}/{col}digraph_get({chars})String · get the |digraph| of {chars}digraph_getlist([{listall}])List · get all |digraph|sdigraph_set({chars}, {digraph})Bool · register |digraph|digraph_setlist({digraphlist})Bool · register multiple |digraph|sechoraw({expr})none · output {expr} as-isempty({expr})Number · |TRUE| if {expr} is emptyenviron()Dict · return environment variableserr_teapot([{expr}])none · give E418, or E503 if {expr} is |TRUE|escape({string}, {chars})String · escape {chars} in {string} with '\'eval({string})any · evaluate {string} into its valueeventhandler()Number · |TRUE| if inside an event handlerexecutable({expr})Number · 1 if executable {expr} existsexecute({command})String · execute {command} and get the outputexepath({expr})String · full path of the command {expr}exists({expr})Number · |TRUE| if {expr} existsexists_compiled({expr})Number · |TRUE| if {expr} exists at compile timeexp({expr})Float · exponential of {expr}expand({expr} [, {nosuf} [, {list}]])any · expand special keywords in {expr}expandcmd({string} [, {options}])String · expand {string} like with `:edit`extend({expr1}, {expr2} [, {expr3}])List/Dict insert items of {expr2} into {expr1} · extendnew({expr1}, {expr2} [, {expr3}])List/Dict like |extend()| but creates a new · List or Dictionaryfeedkeys({string} [, {mode}])Number · add key sequence to typeahead bufferfilecopy({from}, {to})Number · |TRUE| if copying file {from} to {to} workedfilereadable({file})Number · |TRUE| if {file} is a readable filefilewritable({file})Number · |TRUE| if {file} is a writable filefilter({expr1}, {expr2})List/Dict/Blob/String · remove items from {expr1} where {expr2} is 0finddir({name} [, {path} [, {count}]])? · findfile({name} [, {path} [, {count}]])String/List find dir/file {name} in {path} · flatten({list} [, {maxdepth}])List · flatten {list} up to {maxdepth} levelsflattennew({list} [, {maxdepth}])List · flatten a copy of {list}float2nr({expr})Number · convert Float {expr} to a Numberfloor({expr})Float · round {expr} downfmod({expr1}, {expr2})Float · remainder of {expr1} / {expr2}fnameescape({fname})String · escape special characters in {fname}fnamemodify({fname}, {mods})String · modify file namefoldclosed({lnum})Number · first line of fold at {lnum} if closedfoldclosedend({lnum})Number · last line of fold at {lnum} if closedfoldlevel({lnum})Number · fold level at {lnum}foldtext()String · line displayed for closed foldfoldtextresult({lnum})String · text for closed fold at {lnum}foreach({expr1}, {expr2})List/Tuple/Dict/Blob/String · for each item in {expr1} call {expr2}foreground()Number · bring the Vim window to the foregroundfullcommand({name} [, {vim9}])String · get full command from {name}funcref({name} [, {arglist}] [, {dict}])Funcref · reference to function {name}function({name} [, {arglist}] [, {dict}])Funcref · named reference to function {name}garbagecollect([{atexit}])none · free memory, breaking cyclic referencesget({list}, {idx} [, {def}])any · get item {idx} from {list} or {def}get({dict}, {key} [, {def}])any · get item {key} from {dict} or {def}get({func}, {what})any · get property of funcref/partial {func}getbufinfo([{buf}])List · information about buffersgetbufline({buf}, {lnum} [, {end}])List · lines {lnum} to {end} of buffer {buf}getbufoneline({buf}, {lnum})String · line {lnum} of buffer {buf}getbufvar({buf}, {varname} [, {def}])any · variable {varname} in buffer {buf}getcellpixels()List · get character cell pixel sizegetcellwidths()List · get character cell width overridesgetchangelist([{buf}])List · list of change list itemsgetchar([{expr} [, {opts}]])Number or String · get one character from the usergetcharmod()Number · modifiers for the last typed charactergetcharpos({expr})List · position of cursor, mark, etc.getcharsearch()Dict · last character searchgetcharstr([{expr} [, {opts}]])String · get one character from the usergetcmdcomplpat()String · return the completion pattern of the current command-line completiongetcmdcompltype()String · return the type of the current command-line completiongetcmdline()String · return the current command-line inputgetcmdpos()Number · return cursor position in command-linegetcmdprompt()String · return the current command-line promptgetcmdscreenpos()Number · return cursor screen position in command-linegetcmdtype()String · return current command-line typegetcmdwintype()String · return current command-line window typegetcompletion({pat}, {type} [, {filtered}])List · list of cmdline completion matchesgetcompletiontype({pat})String · return the type of the command-line completion using {pat}getcurpos([{winnr}])List · position of the cursorgetcursorcharpos([{winnr}])List · character position of the cursorgetcwd([{winnr} [, {tabnr}]])String · get the current working directorygetenv({name})String · return environment variablegetfontname([{name}])String · name of font being usedgetfperm({fname})String · file permissions of file {fname}getfsize({fname})Number · size in bytes of file {fname}getftime({fname})Number · last modification time of filegetftype({fname})String · description of type of file {fname}getimstatus()Number · |TRUE| if the IME status is activegetjumplist([{winnr} [, {tabnr}]])List · list of jump list itemsgetline({lnum})String · line {lnum} of current buffergetline({lnum}, {end})List · lines {lnum} to {end} of current buffergetloclist({nr})List · list of location list itemsgetloclist({nr}, {what})Dict · get specific location list propertiesgetmarklist([{buf}])List · list of global/local marksgetmatches([{win}])List · list of current matchesgetmousepos()Dict · last known mouse positiongetmouseshape()String · current mouse shape namegetpid()Number · process ID of Vimgetpos({expr})List · position of cursor, mark, etc.getqflist()List · list of quickfix itemsgetqflist({what})Dict · get specific quickfix list propertiesgetreg([{regname} [, 1 [, {list}]]])String or List · contents of a registergetreginfo([{regname}])Dict · information about a registergetregion({pos1}, {pos2} [, {opts}])List · get the text from {pos1} to {pos2}getregionpos({pos1}, {pos2} [, {opts}])List · get a list of positions for a regiongetregtype([{regname}])String · type of a registergetscriptinfo([{opts}])List · list of sourced scriptsgetstacktrace()List · get current stack trace of Vim scriptsgettabinfo([{expr}])List · list of tab pagesgettabvar({nr}, {varname} [, {def}])any · variable {varname} in tab {nr} or {def}gettabwinvar({tabnr}, {winnr}, {name} [, {def}])any · {name} in {winnr} in tab page {tabnr}gettagstack([{nr}])Dict · get the tag stack of window {nr}gettext({text} [, {package}])String · lookup translation of {text}getwininfo([{winid}])List · list of info about each windowgetwinpos([{timeout}])List · X and Y coord in pixels of Vim windowgetwinposx()Number · X coord in pixels of the Vim windowgetwinposy()Number · Y coord in pixels of the Vim windowgetwinvar({nr}, {varname} [, {def}])any · variable {varname} in window {nr}glob({expr} [, {nosuf} [, {list} [, {alllinks}]]])any · expand file wildcards in {expr}glob2regpat({expr})String · convert a glob pat into a search patglobpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]])String · do glob({expr}) for all dirs in {path}has({feature} [, {check}])Number · |TRUE| if feature {feature} supportedhas_key({dict}, {key})Number · |TRUE| if {dict} has entry {key}haslocaldir([{winnr} [, {tabnr}]])Number · |TRUE| if the window executed |:lcd| or |:tcd|hasmapto({what} [, {mode} [, {abbr}]])Number · |TRUE| if mapping to {what} existshistadd({history}, {item})Number · add an item to a historyhistdel({history} [, {item}])Number · remove an item from a historyhistget({history} [, {index}])String · get the item {index} from a historyhistnr({history})Number · highest index of a historyhlID({name})Number · syntax ID of highlight group {name}hlexists({name})Number · |TRUE| if highlight group {name} existshlget([{name} [, {resolve}]])List · get highlight group attributeshlset({list})Number · set highlight group attributeshostname()String · name of the machine Vim is running oniconv({expr}, {from}, {to})String · convert encoding of {expr}id({item})String · get unique identity string of itemindent({lnum})Number · indent of line {lnum}index({object}, {expr} [, {start} [, {ic}]])Number · index in {object} where {expr} appearsindexof({object}, {expr} [, {opts}]])Number · index in {object} where {expr} is trueinput({prompt} [, {text} [, {completion}]])String · get input from the userinputdialog({prompt} [, {text} [, {cancelreturn}]])String · like input() but in a GUI dialoginputlist({textlist})Number · let the user pick from a choice listinputrestore()Number · restore typeaheadinputsave()Number · save and clear typeaheadinputsecret({prompt} [, {text}])String · like input() but hiding the textinsert({object}, {item} [, {idx}])List · insert {item} in {object} [before {idx}]instanceof({object}, {class})Number · |TRUE| if {object} is an instance of {class}interrupt()none · interrupt script executioninvert({expr})Number · bitwise invertisabsolutepath({path})Number · |TRUE| if {path} is an absolute pathisdirectory({directory})Number · |TRUE| if {directory} is a directoryisinf({expr})Number · determine if {expr} is infinity value (positive or negative)islocked({expr})Number · |TRUE| if {expr} is lockedisnan({expr})Number · |TRUE| if {expr} is NaNitems({expr})List · key/index-value pairs in {expr}job_getchannel({job})Channel · get the channel handle for {job}job_info([{job}])Dict · get information about {job}job_setoptions({job}, {options})none · set options for {job}job_start({command} [, {options}])Job · start a jobjob_status({job})String · get the status of {job}job_stop({job} [, {how}])Number · stop {job}join({expr} [, {sep}])String · join items in {expr} into one Stringjs_decode({string})any · decode JS style JSONjs_encode({expr})String · encode JS style JSONjson_decode({string})any · decode JSONjson_encode({expr})String · encode JSONkeys({dict})List · keys in {dict}keytrans({string})String · translate internal keycodes to a form that can be used by |:map|len({expr})Number · the length of {expr}libcall({lib}, {func}, {arg})String · call {func} in library {lib} with {arg}libcallnr({lib}, {func}, {arg})Number · idem, but return a Numberline({expr} [, {winid}])Number · line nr of cursor, last line or markline2byte({lnum})Number · byte count of line {lnum}lispindent({lnum})Number · Lisp indent for line {lnum}list2blob({list})Blob · turn {list} of numbers into a Bloblist2str({list} [, {utf8}])String · turn {list} of numbers into a Stringlist2tuple({list})Tuple · turn {list} of items into a tuplelistener_add({callback} [, {buf}])Number · add a callback to listen to changeslistener_flush([{buf}])none · invoke listener callbackslistener_remove({id})none · remove a listener callbacklocaltime()Number · current timelog({expr})Float · natural logarithm (base e) of {expr}log10({expr})Float · logarithm of Float {expr} to base 10luaeval({expr} [, {expr}])any · evaluate |Lua| expressionmap({expr1}, {expr2})List/Dict/Blob/String · change each item in {expr1} to {expr2}maparg({name} [, {mode} [, {abbr} [, {dict}]]])String or Dict · rhs of mapping {name} in mode {mode}mapcheck({name} [, {mode} [, {abbr}]])String · check for mappings matching {name}maplist([{abbr}])List · list of all mappings, a dict for eachmapnew({expr1}, {expr2})List/Dict/Blob/String · like |map()| but creates a new List or Dictionarymapset({mode}, {abbr}, {dict})none · restore mapping from |maparg()| resultmatch({expr}, {pat} [, {start} [, {count}]])Number · position where {pat} matches in {expr}matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]])Number · highlight {pattern} with {group}matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]])Number · highlight positions with {group}matcharg({nr})List · arguments of |:match|matchbufline({buf}, {pat}, {lnum}, {end}, [, {dict})List · all the {pat} matches in buffer {buf}matchdelete({id} [, {win}])Number · delete match identified by {id}matchend({expr}, {pat} [, {start} [, {count}]])Number · position where {pat} ends in {expr}matchfuzzy({list}, {str} [, {dict}])List · fuzzy match {str} in {list}matchfuzzypos({list}, {str} [, {dict}])List · fuzzy match {str} in {list}matchlist({expr}, {pat} [, {start} [, {count}]])List · match and submatches of {pat} in {expr}matchstr({expr}, {pat} [, {start} [, {count}]])String · {count}'th match of {pat} in {expr}matchstrlist({list}, {pat} [, {dict})List · all the {pat} matches in {list}matchstrpos({expr}, {pat} [, {start} [, {count}]])List · {count}'th match of {pat} in {expr}max({expr})Number · maximum value of items in {expr}menu_info({name} [, {mode}])Dict · get menu item informationmin({expr})Number · minimum value of items in {expr}mkdir({name} [, {flags} [, {prot}]])Number · create directory {name}mode([{expr}])String · current editing modemzeval({expr})any · evaluate |MzScheme| expressionnextnonblank({lnum})Number · line nr of non-blank line >= {lnum}ngettext({single}, {plural}, {number}[, {domain}])String · translate text based on {number}nr2char({expr} [, {utf8}])String · single char with ASCII/UTF-8 value {expr}or({expr}, {expr})Number · bitwise ORpathshorten({expr} [, {len}])String · shorten directory names in a pathperleval({expr})any · evaluate |Perl| expressionpopup_atcursor({what}, {options})Number create popup window near the cursor · popup_beval({what}, {options})Number · create popup window for 'ballooneval'popup_clear()none · close all popup windowspopup_close({id} [, {result}])none · close popup window {id}popup_create({what}, {options})Number · create a popup windowpopup_dialog({what}, {options})Number · create a popup window used as a dialogpopup_filter_menu({id}, {key})Number · filter for a menu popup windowpopup_filter_yesno({id}, {key})Number · filter for a dialog popup windowpopup_findecho()Number · get window ID of popup for `:echowin`popup_findinfo()Number · get window ID of info popup windowpopup_findpreview()Number · get window ID of preview popup windowpopup_getoptions({id})Dict · get options of popup window {id}popup_getpos({id})Dict · get position of popup window {id}popup_hide({id})none · hide popup menu {id}popup_list()List · get a list of window IDs of all popupspopup_locate({row}, {col})Number · get window ID of popup at positionpopup_menu({what}, {options})Number · create a popup window used as a menupopup_move({id}, {options})none · set position of popup window {id}popup_notification({what}, {options})Number · create a notification popup windowpopup_setbuf({id}, {buf})Bool · set the buffer for the popup window {id}popup_setoptions({id}, {options})none · set options for popup window {id}popup_settext({id}, {text})none · set the text of popup window {id}popup_show({id})none · unhide popup window {id}pow({x}, {y})Float · {x} to the power of {y}prevnonblank({lnum})Number · line nr of non-blank line <= {lnum}printf({fmt}, {expr1}...)String · format textprompt_getprompt({buf})String · get prompt textprompt_setcallback({buf}, {expr})none · set prompt callback functionprompt_setinterrupt({buf}, {text})none · set prompt interrupt functionprompt_setprompt({buf}, {text})none · set prompt textprop_add({lnum}, {col}, {props})none · add one text propertyprop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...])none · add multiple text propertiesprop_clear({lnum} [, {lnum-end} [, {props}]])none · remove all text propertiesprop_find({props} [, {direction}])Dict · search for a text propertyprop_list({lnum} [, {props}])List · text properties in {lnum}prop_remove({props} [, {lnum} [, {lnum-end}]])Number · remove a text propertyprop_type_add({name}, {props})none · define a new property typeprop_type_change({name}, {props})none · change an existing property typeprop_type_delete({name} [, {props}])none · delete a property typeprop_type_get({name} [, {props}])Dict · get property type valuesprop_type_list([{props}])List · get list of property typespum_getpos()Dict · position and size of pum if visiblepumvisible()Number · whether popup menu is visiblepy3eval({expr} [, {locals}])any · evaluate |python3| expressionpyeval({expr} [, {locals}])any · evaluate |Python| expressionpyxeval({expr} [, {locals}])any · evaluate |python_x| expressionrand([{expr}])Number · get pseudo-random numberrange({expr} [, {max} [, {stride}]])List · items from {expr} to {max}readblob({fname} [, {offset} [, {size}]])Blob · read a |Blob| from {fname}readdir({dir} [, {expr} [, {dict}]])List · file names in {dir} selected by {expr}readdirex({dir} [, {expr} [, {dict}]])List · file info in {dir} selected by {expr}readfile({fname} [, {type} [, {max}]])List · get list of lines from file {fname}reduce({object}, {func} [, {initial}])any · reduce {object} using {func}reg_executing()String · get the executing register namereg_recording()String · get the recording register namereltime([{start} [, {end}]])List · get time valuereltimefloat({time})Float · turn the time value into a Floatreltimestr({time})String · turn time value into a Stringremote_expr({server}, {string} [, {idvar} [, {timeout}]])String · send expressionremote_foreground({server})Number · bring Vim server to the foregroundremote_peek({serverid} [, {retvar}])Number · check for reply stringremote_read({serverid} [, {timeout}])String · read reply stringremote_send({server}, {string} [, {idvar}])String · send key sequenceremote_startserver({name})none · become server {name}remove({list}, {idx} [, {end}])any/List · remove items {idx}-{end} from {list}remove({blob}, {idx} [, {end}])Number/Blob · remove bytes {idx}-{end} from {blob}remove({dict}, {key})any · remove entry {key} from {dict}rename({from}, {to})Number · rename (move) file from {from} to {to}repeat({expr}, {count})List/Tuple/Blob/String · repeat {expr} {count} timesresolve({filename})String · get filename a shortcut points toreverse({obj})List/Tuple/Blob/String · reverse {obj}round({expr})Float · round off {expr}rubyeval({expr})any · evaluate |Ruby| expressionscreenattr({row}, {col})Number · attribute at screen positionscreenchar({row}, {col})Number · character at screen positionscreenchars({row}, {col})List · List of characters at screen positionscreencol()Number · current cursor columnscreenpos({winid}, {lnum}, {col})Dict · screen row and col of a text characterscreenrow()Number · current cursor rowscreenstring({row}, {col})String · characters at screen positionsearch({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])Number · search for {pattern}searchcount([{options}])Dict · get or update search statssearchdecl({name} [, {global} [, {thisblock}]])Number · search for variable declarationsearchpair({start}, {middle}, {end} [, {flags} [, {skip} [...]]])Number · search for other end of start/end pairsearchpairpos({start}, {middle}, {end} [, {flags} [, {skip} [...]]])List · search for other end of start/end pairsearchpos({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])List · search for {pattern}server2client({clientid}, {string})Number · send reply stringserverlist()String · get a list of available serverssetbufline({buf}, {lnum}, {text})Number · set line {lnum} to {text} in buffer {buf}setbufvar({buf}, {varname}, {val})none · set {varname} in buffer {buf} to {val}setcellwidths({list})none · set character cell width overridessetcharpos({expr}, {list})Number · set the {expr} position to {list}setcharsearch({dict})Dict · set character search from {dict}setcmdline({str} [, {pos}])Number · set command-linesetcmdpos({pos})Number · set cursor position in command-linesetcursorcharpos({list})Number · move cursor to position in {list}setenv({name}, {val})none · set environment variablesetfperm({fname}, {mode})Number · set {fname} file permissions to {mode}setline({lnum}, {line})Number · set line {lnum} to {line}setloclist({nr}, {list} [, {action}])Number · modify location list using {list}setloclist({nr}, {list}, {action}, {what})Number · modify specific location list propssetmatches({list} [, {win}])Number · restore a list of matchessetpos({expr}, {list})Number · set the {expr} position to {list}setqflist({list} [, {action}])Number · modify quickfix list using {list}setqflist({list}, {action}, {what})Number · modify specific quickfix list propssetreg({n}, {v} [, {opt}])Number · set register to value and typesettabvar({nr}, {varname}, {val})none · set {varname} in tab page {nr} to {val}settabwinvar({tabnr}, {winnr}, {varname}, {val})none · set {varname} in window {winnr} in tab page {tabnr} to {val}settagstack({nr}, {dict} [, {action}])Number · modify tag stack using {dict}setwinvar({nr}, {varname}, {val})none · set {varname} in window {nr} to {val}sha256({string})String · SHA256 checksum of {string}shellescape({string} [, {special}])String · escape {string} for use as shell command argumentshiftwidth([{col}])Number · effective value of 'shiftwidth'sign_define({name} [, {dict}])Number · define or update a signsign_define({list})List · define or update a list of signssign_getdefined([{name}])List · get a list of defined signssign_getplaced([{buf} [, {dict}]])List · get a list of placed signssign_jump({id}, {group}, {buf})Number · jump to a signsign_place({id}, {group}, {name}, {buf} [, {dict}])Number · place a signsign_placelist({list})List · place a list of signssign_undefine([{name}])Number · undefine a signsign_undefine({list})List · undefine a list of signssign_unplace({group} [, {dict}])Number · unplace a signsign_unplacelist({list})List · unplace a list of signssimplify({filename})String · simplify filename as much as possiblesin({expr})Float · sine of {expr}sinh({expr})Float · hyperbolic sine of {expr}slice({expr}, {start} [, {end}])String, List or Blob · slice of a String, List or Blobsort({list} [, {how} [, {dict}]])List · sort {list}, compare with {how}sound_clear()none · stop playing all soundssound_playevent({name} [, {callback}])Number · play an event soundsound_playfile({path} [, {callback}])Number · play sound file {path}sound_stop({id})none · stop playing sound {id}soundfold({word})String · sound-fold {word}spellbadword()String · badly spelled word at cursorspellsuggest({word} [, {max} [, {capital}]])List · spelling suggestionssplit({expr} [, {pat} [, {keepempty}]])List · make |List| from {pat} separated {expr}sqrt({expr})Float · square root of {expr}srand([{expr}])List · get seed for |rand()|state([{what}])String · current state of Vimstr2blob({list} [, {options}])Blob · convert list of strings into a Blobstr2float({expr} [, {quoted}])Float · convert String to Floatstr2list({expr} [, {utf8}])List · convert each character of {expr} to ASCII/UTF-8 valuestr2nr({expr} [, {base} [, {quoted}]])Number · convert String to Numberstrcharlen({expr})Number · character length of the String {expr}strcharpart({str}, {start} [, {len} [, {skipcc}]])String · {len} characters of {str} at character {start}strchars({expr} [, {skipcc}])Number · character count of the String {expr}strdisplaywidth({expr} [, {col}])Number display length of the String {expr} · strftime({format} [, {time}])String · format time with a specified formatstrgetchar({str}, {index})Number · get char {index} from {str}stridx({haystack}, {needle} [, {start}])Number · index of {needle} in {haystack}string({expr})String · String representation of {expr} valuestrlen({expr})Number · length of the String {expr}strpart({str}, {start} [, {len} [, {chars}]])String · {len} bytes/chars of {str} at byte {start}strptime({format}, {timestring})Number · Convert {timestring} to unix timestampstrridx({haystack}, {needle} [, {start}])Number · last index of {needle} in {haystack}strtrans({expr})String · translate string to make it printablestrutf16len({string} [, {countcc}])Number · number of UTF-16 code units in {string}strwidth({expr})Number · display cell length of the String {expr}submatch({nr} [, {list}])String or List · specific match in ":s" or substitute()substitute({expr}, {pat}, {sub}, {flags})String · all {pat} in {expr} replaced with {sub}swapfilelist()List · swap files found in 'directory'swapinfo({fname})Dict · information about swap file {fname}swapname({buf})String · swap file of buffer {buf}synID({lnum}, {col}, {trans})Number · syntax ID at {lnum} and {col}synIDattr({synID}, {what} [, {mode}])String · attribute {what} of syntax ID {synID}synIDtrans({synID})Number · translated syntax ID of {synID}synconcealed({lnum}, {col})List · info about concealingsynstack({lnum}, {col})List · stack of syntax IDs at {lnum} and {col}system({expr} [, {input}])String · output of shell command/filter {expr}systemlist({expr} [, {input}])List · output of shell command/filter {expr}tabpagebuflist([{arg}])List · list of buffer numbers in tab pagetabpagenr([{arg}])Number · number of current or last tab pagetabpagewinnr({tabarg} [, {arg}])Number · number of current window in tab pagetagfiles()List · tags files usedtaglist({expr} [, {filename}])List · list of tags matching {expr}tan({expr})Float · tangent of {expr}tanh({expr})Float · hyperbolic tangent of {expr}tempname()String · name for a temporary fileterm_dumpdiff({filename}, {filename} [, {options}])Number · display difference between two dumpsterm_dumpload({filename} [, {options}])Number · displaying a screen dumpterm_dumpwrite({buf}, {filename} [, {options}])none · dump terminal window contentsterm_getaltscreen({buf})Number · get the alternate screen flagterm_getansicolors({buf})List · get ANSI palette in GUI color modeterm_getattr({attr}, {what})Number · get the value of attribute {what}term_getcursor({buf})List · get the cursor position of a terminalterm_getjob({buf})Job · get the job associated with a terminalterm_getline({buf}, {row})String · get a line of text from a terminalterm_getscrolled({buf})Number · get the scroll count of a terminalterm_getsize({buf})List · get the size of a terminalterm_getstatus({buf})String · get the status of a terminalterm_gettitle({buf})String · get the title of a terminalterm_gettty({buf}, [{input}])String · get the tty name of a terminalterm_list()List · get the list of terminal buffersterm_scrape({buf}, {row})List · get row of a terminal screenterm_sendkeys({buf}, {keys})none · send keystrokes to a terminalterm_setansicolors({buf}, {colors})none · set ANSI palette in GUI color modeterm_setapi({buf}, {expr})none · set |terminal-api| function name prefixterm_setkill({buf}, {how})none · set signal to stop job in terminalterm_setrestore({buf}, {command})none · set command to restore terminalterm_setsize({buf}, {rows}, {cols})none · set the size of a terminalterm_start({cmd} [, {options}])Number · open a terminal window and run a jobterm_wait({buf} [, {time}])Number · wait for screen to be updatedterminalprops()Dict · properties of the terminaltest_alloc_fail({id}, {countdown}, {repeat})none · make memory allocation failtest_autochdir()none · enable 'autochdir' during startuptest_feedinput({string})none · add key sequence to input buffertest_garbagecollect_now()none · free memory right now for testingtest_garbagecollect_soon()none · free memory soon for testingtest_getvalue({string})any · get value of an internal variabletest_gui_event({event}, {args})bool · generate a GUI event for testingtest_ignore_error({expr})none · ignore a specific errortest_mswin_event({event}, {args})bool · generate MS-Windows event for testingtest_null_blob()Blob · null value for testingtest_null_channel()Channel · null value for testingtest_null_dict()Dict · null value for testingtest_null_function()Funcref · null value for testingtest_null_job()Job · null value for testingtest_null_list()List · null value for testingtest_null_partial()Funcref · null value for testingtest_null_string()String · null value for testingtest_null_tuple()Tuple · null value for testingtest_option_not_set({name})none · reset flag indicating option was settest_override({expr}, {val})none · test with Vim internal overridestest_refcount({expr})Number · get the reference count of {expr}test_setmouse({row}, {col})none · set the mouse position for testingtest_settime({expr})none · set current time for testingtest_srand_seed([{seed}])none · set seed for testing srand()test_unknown()any · unknown value for testingtest_void()any · void value for testingtimer_info([{id}])List · information about timerstimer_pause({id}, {pause})none · pause or unpause a timertimer_start({time}, {callback} [, {options}])Number · create a timertimer_stop({timer})none · stop a timertimer_stopall()none · stop all timerstolower({expr})String · the String {expr} switched to lowercasetoupper({expr})String · the String {expr} switched to uppercasetr({src}, {fromstr}, {tostr})String · translate chars of {src} in {fromstr} to chars in {tostr}trim({text} [, {mask} [, {dir}]])String · trim characters in {mask} from {text}trunc({expr})Float · truncate Float {expr}tuple2list({tuple})List · turn {tuple} of items into a listtype({expr})Number · type of value {expr}typename({expr})String · representation of the type of {expr}undofile({name})String · undo file name for {name}undotree([{buf}])List · undo file tree for buffer {buf}uniq({list} [, {func} [, {dict}]])List · remove adjacent duplicates from a listuri_decode({string})String · URI-decode a stringuri_encode({string})String · URI-encode a stringutf16idx({string}, {idx} [, {countcc} [, {charidx}]])Number · UTF-16 index of byte {idx} in {string}values({dict})List · values in {dict}virtcol({expr} [, {list} [, {winid}])Number or List · screen column of cursor or markvirtcol2col({winid}, {lnum}, {col})Number · byte index of a character on screenvisualmode([{expr}])String · last visual mode usedwildmenumode()Number · whether 'wildmenu' mode is activewildtrigger()Number · start wildcard expansionwin_execute({id}, {command} [, {silent}])String · execute {command} in window {id}win_findbuf({bufnr})List · find windows containing {bufnr}win_getid([{win} [, {tab}]])Number · get window ID for {win} in {tab}win_gettype([{nr}])String · type of window {nr}win_gotoid({expr})Number · go to window with ID {expr}win_id2tabwin({expr})List · get tab and window nr from window IDwin_id2win({expr})Number · get window nr from window IDwin_move_separator({nr})Number · move window vertical separatorwin_move_statusline({nr})Number · move window status linewin_screenpos({nr})List · get screen position of window {nr}win_splitmove({nr}, {target} [, {options}])Number · move window {nr} to split of {target}winbufnr({nr})Number · buffer number of window {nr}wincol()Number · window column of the cursorwindowsversion()String · MS-Windows OS versionwinheight({nr})Number · height of window {nr}winlayout([{tabnr}])List · layout of windows in tab {tabnr}winline()Number · window line of the cursorwinnr([{expr}])Number · number of current windowwinrestcmd()String · returns command to restore window sizeswinrestview({dict})none · restore view of current windowwinsaveview()Dict · save view of current windowwinwidth({nr})Number · width of window {nr}wordcount()Dict · get byte/char/word statisticswritefile({object}, {fname} [, {flags}])Number · write |Blob| or |List| of lines to filexor({expr}, {expr})Number · bitwise XORAutocommand Events
119Every event :autocmd can hook
BufDeleteBefore deleting a buffer from the buffer list.BufEnterAfter entering a buffer. Useful for settingBufFilePostAfter changing the name of the current bufferBufFilePreBefore changing the name of the current bufferBufHiddenJust before a buffer becomes hidden. That is,BufLeaveBefore leaving to another buffer. Also whenBufNewJust after creating a new buffer. Also usedBufNewFileWhen starting to edit a file that doesn'tBufReadCmdBefore starting to edit a new buffer. ShouldBufReadPreWhen starting to edit a new buffer, beforeBufUnloadBefore unloading a buffer. This is when theBufWinEnterAfter a buffer is displayed in a window. ThisBufWinLeaveBefore a buffer is removed from a window.BufWipeoutBefore completely deleting a buffer. TheBufWriteCmdBefore writing the whole buffer to a file.BufWritePostAfter writing the whole buffer to a fileCmdUndefinedWhen a user command is used but it isn'tCmdlineChangedAfter a change was made to the text in theCmdlineEnterAfter moving the cursor to the command line,CmdlineLeaveBefore leaving the command line; includingCmdlineLeavePreJust before leaving the command line, andCmdwinEnterAfter entering the command-line window.CmdwinLeaveBefore leaving the command-line window.ColorSchemeAfter loading a color scheme. |:colorscheme|ColorSchemePreBefore loading a color scheme. |:colorscheme|CompleteChanged*CompleteChanged*CompleteDonePreAfter Insert mode completion is done. EitherCompleteDoneAfter Insert mode completion is done. EitherCursorHoldWhen the user doesn't press a key for the timeCursorHoldIJust like CursorHold, but in Insert mode.CursorMovedAfter the cursor was moved in Normal or VisualCursorMovedCAfter the cursor was moved in the commandCursorMovedIAfter the cursor was moved in Insert mode.DiffUpdatedAfter diffs have been updated. Depending onDirChangedPreThe working directory is going to be changed,DirChangedThe working directory has changed in responseEncodingChangedFires off after the 'encoding' option has beenExitPreWhen using `:quit`, `:wq` in a way it makesFileAppendCmdBefore appending to a file. Should do theFileAppendPostAfter appending to a file.FileAppendPreBefore appending to a file. Use the '[ and ']FileChangedROBefore making the first change to a read-onlyFileChangedShellWhen Vim notices that the modification time ofFileChangedShellPostAfter handling a file that was changed outsideFileEncodingObsolete. It still works and is equivalentFileReadCmdBefore reading a file with a ":read" command.FileReadPostAfter reading a file with a ":read" command.FileReadPreBefore reading a file with a ":read" command.FileTypeWhen the 'filetype' option has been set. TheFileWriteCmdBefore writing to a file, when not writing theFileWritePostAfter writing to a file, when not writing theFileWritePreBefore writing to a file, when not writing theFilterReadPostAfter reading a file from a filter command.FilterReadPreBefore reading a file from a filter command.FilterWritePostAfter writing a file for a filter command orFilterWritePreBefore writing a file for a filter command orFocusGainedWhen Vim got input focus. Only for the GUIFocusLostWhen Vim lost input focus. Only for the GUIFuncUndefinedWhen a user function is used but it isn'tGUIEnterAfter starting the GUI successfully, and afterGUIFailedAfter starting the GUI failed. Vim mayInsertChangeWhen typing <Insert> while in Insert orInsertCharPreWhen a character is typed in Insert mode,InsertEnterJust before starting Insert mode. Also forInsertLeavePreJust before leaving Insert mode. Also whenInsertLeaveJust after leaving Insert mode. Also whenKeyInputPreJust before a key is processed after mappingsMenuPopupJust before showing the popup menu (under theModeChangedAfter changing the mode. The pattern isOptionSetAfter setting an option. The pattern isQuickFixCmdPreBefore a quickfix command is run (|:make|,QuickFixCmdPostLike QuickFixCmdPre, but after a quickfixQuitPreWhen using `:quit`, `:wq` or `:qall`, beforeRemoteReplyWhen a reply from a Vim that functions asSafeStateWhen nothing is pending, going to wait for theSafeStateAgainLike SafeState but after processing anySessionLoadPostAfter loading the session file created usingSessionWritePostAfter writing a session file by callingShellCmdPostAfter executing a shell command with |:!cmd|,ShellFilterPostAfter executing a shell command withSourcePreBefore sourcing a Vim script. |:source|SourcePostAfter sourcing a Vim script. |:source|SourceCmdWhen sourcing a Vim script. |:source|SpellFileMissingWhen trying to load a spell checking file andStdinReadPostAfter reading from the stdin into the buffer,StdinReadPreBefore reading from stdin into the buffer.SwapExistsDetected an existing swap file when startingSyntaxWhen the 'syntax' option has been set. TheTabClosedAfter closing a tab page.TabClosedPreBefore closing a tab page. The window layoutTabEnterJust after entering a tab page. |tab-page|TabLeaveJust before leaving a tab page. |tab-page|TabNewWhen a tab page was created. |tab-page|TermChangedAfter the value of 'term' has changed. UsefulTerminalOpenJust after a terminal buffer was created, withTerminalWinOpenJust after a terminal buffer was created, withTermResponseAfter the response to |t_RV| is received fromTermResponseAllAfter the response to |t_RV|, |t_RC|, |t_RS|,TextChangedAfter a change was made to the text in theTextChangedIAfter a change was made to the text in theTextChangedPAfter a change was made to the text in theTextChangedTAfter a change was made to the text in theTextYankPostAfter text has been yanked or deleted in theUserNever executed automatically. To be used forSigUSR1After the SIGUSR1 signal has been detected.UserGettingBoredWhen the user presses the same key 42 times.VimEnterAfter doing all the startup stuff, includingVimLeaveBefore exiting Vim, just after writing theVimLeavePreBefore exiting Vim, just before writing theVimResizedAfter the Vim window was resized, thus 'lines'VimResumeWhen the Vim instance is resumed after beingVimSuspendWhen the Vim instance is suspended. Only whenWinClosedWhen closing a window, just before it isWinEnterAfter entering another window. Not done forWinLeaveBefore leaving a window. If the window to beWinNewPreBefore creating a new window. TriggeredWinNewWhen a new window was created. Not done forWinScrolledAfter any window in the current tab pageWinResizedAfter a window in the current tab page changedStarting Vim
22Command-line arguments, files and paths
vim {file}...open files as the argument listvim +{n} {file}open at line n; + alone means the last linevim +/{pat} {file}open at the first match of patvim -c {cmd} / -S {file}run an ex command / source a script after loadingvim -u {vimrc}use this vimrc instead of the usual onesvim --cleanno vimrc, no plugins, no viminfo, defaults onvim --nopluginread the vimrc but skip plugin loadingvim -R / viewread-only modevim -d f1 f2 / vimdiffdiff modevim -o {n} / -O / -popen files in horizontal splits / vertical splits / tabsvim -bbinary modevim -xedit an encrypted filevim -es / -Essilent ex / silent improved-ex mode — scriptingvim --startuptime {file}log startup timingsvim --versionversion, patches and the feature listvim --remote-send / --servernamedrive a running Vim from another process$MYVIMRCpath of the vimrc that was actually read~/.vimrcuser vimrc on macOS and Linux~\_vimrcuser vimrc on Windows~/.vim/ · ~\vimfiles\the user runtime directory:versionthe same information from inside Vim:h {subject}the help — the only reference that is always right