Normal Mode
204Every normal-mode command, from Nvim’s 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-WCTRL-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 Normal mode (no-op) CTRL-\ a - z reserved for extensions CTRL-\ others not usedCTRL-]:ta to ident under cursorCTRL-^edit Nth alternate file (equivalent to ":e #N")CTRL-<Tab>same as g<Tab> : go to last accessed tab page 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 timesRenter 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" Note: Mapped to "y$" by default. default-mappingsZZwrite 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 recordingQreplay last recorded registerq: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 charwise 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>*<ScrollWheelDown> move window three lines down*<S-ScrollWheelDown>*<S-ScrollWheelDown> move window one page down*<ScrollWheelUp>*<ScrollWheelUp> move window three lines up*<S-ScrollWheelUp>*<S-ScrollWheelUp> move window one page up*<ScrollWheelLeft>*<ScrollWheelLeft> move window six columns left*<S-ScrollWheelLeft>*<S-ScrollWheelLeft> move window one page left*<ScrollWheelRight>*<ScrollWheelRight> move window six columns right*<S-ScrollWheelRight>*<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 mode
vforce operator to work charwiseVforce operator to work linewiseCTRL-Vforce operator to work blockwiseInsert Mode
85Insert and replace mode
CTRL-@insert previously inserted text and stop insertCTRL-Ainsert previously inserted textCTRL-Cquit insert mode, without checking for abbreviationCTRL-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 digraph<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 tui-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 tui-modifyOtherKeys is active byte.CTRL-Wdelete word before the cursorCTRL-X {mode}enter CTRL-X sub mode, see i_CTRL-X_indexCTRL-Yinsert the character which is above the cursor<Esc>end insert modeCTRL-[same as <Esc> CTRL-\ a - z reserved for extensions CTRL-\ others not usedCTRL-]trigger abbreviationCTRL-^toggle use of :lmap mappingsCTRL-_When 'allowrevins' set: toggle 'revins' <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, text is unchangedCTRL-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 unchangedRdelete 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 charwise or stop Visual modexdelete the highlighted areayyank the highlighted area~swap case for the highlighted areaWindow Commands
73CTRL-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 <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 tabpageCTRL-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 tabpageCTRL-W g Fedit file name under the cursor in a new tabpage and jump to the line number following the file name.CTRL-W g tsame as gt: go to next tabpageCTRL-W g Tsame as gT: go to previous tabpageCTRL-W g <Tab>same as g<Tab>: go to last accessed tab pageCTRL-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 ]
[ 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-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 tabpagegU{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 tabpagegu{motion}make Nmove text lowercasegvreselect the previous Visual areagw{motion}format Nmove text and keep cursorgxexecute application for filepath at cursorg@{motion}call 'operatorfunc'g~{motion}swap case for Nmove textg<Down>same as "gj"g<End>same as "g$" but go to the rightmost non-blank character insteadg<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 last accessed tabpageg<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 zwzugundo zgzuWundo zWzuGundo zGzvopen 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 Editing
46Keys while typing a : / or ? line
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 characters between the cursor and beginning of command-lineCTRL-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> CTRL-\ a - d reserved for extensions {expr} CTRL-\ f - z reserved for extensions CTRL-\ others not usedCTRL-]trigger abbreviationCTRL-^toggle use of :lmap mappings<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 <Down> move down to submenu <Left> select the previous match <Right> select the next match <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 forwardRegisters, 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 listRange atoms for ex commands
{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
553Every ":" command Neovim has
: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:a[ppend]append text:ab[breviate]enter abbreviation:abc[lear]remove all abbreviations:abo[veleft]make split window appear left or above: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: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[ckhealth]run healthchecks:checkp[ath]list included files:checkt[ime]check timestamp of loaded buffers:chi[story]list the error lists:cla[st]go to the specified error, default last one:cle[arjumps]clear the jump list: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: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: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:detachdetach the current UI: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: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: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>:el[se]part of an :if command:elsei[f]part of an :if command:em[enu]execute a menu by name:en[dif]end previous :if: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:ev[al]evaluate an expression and discard the result:exsame as ":edit":exe[cute]execute result of expressions:exi[t]same as ":xit":exu[sage]overview of Ex commands:fc[lose]close floating window: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: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: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:h[elp]open a help window:helpc[lose]close one 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: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: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: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: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:lsplanguage server protocol: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: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 shada file: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: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:perld[o]execute perl command for each line:perlf[ile]execute perl script file:p[rint]print lines:profd[el]stop profiling a function or script:prof[ile]profiling functions and scripts: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: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) and window bar(s):reg[isters]display the contents of registers:res[ize]change current window height:restartrestart the Nvim server: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:rsh[ada]read from shada file: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':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: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: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: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: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 tabpage:tabc[lose]close current tabpage:tabd[o]execute command in each tabpage:tabe[dit]edit a file in a new tabpage:tabf[ind]find file in 'path', edit it in a new tabpage:tabfir[st]go to first tabpage:tabl[ast]go to last tabpage:tabm[ove]move tabpage to other position:tabnewedit a file in a new tabpage:tabn[ext]go to next tabpage:tabo[nly]close all tabpages except the current one:tabp[revious]go to previous tabpage:tabr[ewind]go to first tabpage:tabslist the tabpages 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 tabpage:tch[dir]change directory for tabpage:te[rminal]open a terminal buffer:tf[irst]jump to first matching tag:th[row]throw an exception: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-mode:tln[oremenu]like ":noremenu" but for Terminal-mode:tlu[nmenu]remove menu for Terminal-mode:tmapc[lear]remove all mappings for Terminal-mode:tma[p]like ":map" but for Terminal-mode:tm[enu]define menu tooltip:tn[ext]jump to next matching tag:tno[remap]like ":noremap" but for Terminal-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:trustadd or remove file from trust database:tryexecute commands, abort on error or exception:ts[elect]list matching tags and select one:tunma[p]like ":unmap" but for Terminal-mode:tu[nmenu]remove menu tooltip: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:ve[rsion]print version number and other info:verb[ose]execute command with 'verbose' set:vert[ical]make following command split vertically: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: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:wsh[ada]write to ShaDa file:wu[ndo]write undo information to a 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: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
374Every option, with its abbreviation; hover for Nvim’s default
'aleph' 'al'legacy name, still accepted so an old vimrc loads'allowrevins' 'ari'allow CTRL-_ in Insert mode'ambiwidth' 'ambw'what to do with Unicode chars of ambiguous width'arabic' 'arab'for Arabic as a default second language'arabicshape' 'arshape'do shaping for Arabic characters'autochdir' 'acd'change directory to the file in the current window'autocomplete' 'ac'enable automatic completion in insert mode'autocompletedelay' 'acl'delay in msec before menu appears after typing'autocompletetimeout' 'act'initial decay timeout for autocompletion algorithm'autoindent' 'ai'take indent for new line from previous line'autoread' 'ar'autom. read file when changed outside of Vim'autowrite' 'aw'automatically write file if changed'autowriteall' 'awa'as 'autowrite', but works with more commands'background' 'bg'"dark" or "light", used for highlight colors'backspace' 'bs'how backspace works at start of line'backup' 'bk'keep backup file after overwriting a file'backupcopy' 'bkc'make backup as a copy, don't rename the file'backupdir' 'bdir'list of directories for the backup file'backupext' 'bex'extension used for the backup file'backupskip' 'bsk'no backup for files that match these patterns'belloff' 'bo'do not ring the bell for these reasons'binary' 'bin'read/write/edit file in binary mode'bomb'prepend a Byte Order Mark to the file'breakat' 'brk'characters that may cause a line break'breakindent' 'bri'wrapped line repeats indent'breakindentopt' 'briopt'settings for 'breakindent''browsedir' 'bsdir'which directory to start browsing in'bufhidden' 'bh'what to do when buffer is no longer in window'buflisted' 'bl'whether the buffer shows up in the buffer list'buftype' 'bt'special type of buffer'busy'Sets a buffer "busy" status.'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'channel'channel connected to the buffer, or 0 if no channel is connected.'charconvert' 'ccv'expression for character encoding conversion'chistory' 'chi'maximum number of quickfix lists in history'cindent' 'cin'do C program indenting'cinkeys' 'cink'keys that trigger indent when 'cindent' is set'cinoptions' 'cino'how to do indenting when 'cindent' is set'cinscopedecls' 'cinsd'words that are recognized by 'cino-g''cinwords' 'cinw'words where 'si' and 'cin' add an indent'clipboard' 'cb'use the clipboard as the unnamed register'cmdheight' 'ch'number of lines to use for the command-line'cmdwinheight' 'cwh'height of the command-line window'colorcolumn' 'cc'columns to highlight'columns' 'co'number of columns in the display'comments' 'com'patterns that can start a comment line'commentstring' 'cms'template for comments; used for fold marker'compatible' 'cp'legacy name, still accepted so an old vimrc loads — (Nvim is always "nocompatible".)'complete' 'cpt'specify how Insert mode completion works'completefunc' 'cfu'function to be used for Insert mode completion'completeitemalign' 'cia'A comma-separated list of strings that controls the alignment and display order of items in the popup menu during Insert mode completion.'completeopt' 'cot'options for Insert mode completion'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'copyindent' 'ci'make 'autoindent' use existing indent structure'cpoptions' 'cpo'flags for Vi-compatible behavior'cursorbind' 'crb'move cursor in window as it moves in other windows'cursorcolumn' 'cuc'highlight the screen column of the cursor'cursorline' 'cul'highlight the screen line of the cursor'cursorlineopt' 'culopt'settings for 'cursorline''debug'set to "msg" to see all error messages'define' 'def'pattern to be used to find a macro definition'delcombine' 'deco'delete combining characters on their own'dictionary' 'dict'list of file names used for keyword completion'diff'use diff mode for the current window'diffanchors' 'dia'list of {address} to force anchoring of a diff'diffexpr' 'dex'expression used to obtain a diff file'diffopt' 'dip'options for using diff mode'digraph' 'dg'enable the entering of digraphs in Insert mode'directory' 'dir'list of directory names for the swap file'display' 'dy'list of flags for how to display text'eadirection' 'ead'in which direction 'equalalways' works'edcompatible' 'ed'legacy name, still accepted so an old vimrc loads'emoji' 'emo'When on all Unicode emoji characters are considered to be 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'eventignore' 'ei'autocommand events that are ignored'eventignorewin' 'eiw'autocommand events that are ignored in a window'expandtab' 'et'use spaces when <Tab> is inserted'exrc' 'ex'read init files in the current directory'fileencoding' 'fenc'file encoding for multibyte text'fileencodings' 'fencs'automatically detected character encodings'fileformat' 'ff'file format used for file I/O'fileformats' 'ffs'automatically detected values for 'fileformat''fileignorecase' 'fic'ignore case when using file names'filetype' 'ft'type of file, used for autocommands'fillchars' 'fcs'characters to use for displaying special items'findfunc' 'ffu'function to be called for the :find command'fixendofline' 'fixeol'make sure last line in file has <EOL>'foldclose' 'fcl'close a fold when the cursor leaves it'foldcolumn' 'fdc'width of the column used to indicate folds'foldenable' 'fen'set to display all folds open'foldexpr' 'fde'expression used when 'foldmethod' is "expr"'foldignore' 'fdi'ignore lines when 'foldmethod' is "indent"'foldlevel' 'fdl'close folds with a level higher than this'foldlevelstart' 'fdls''foldlevel' when starting to edit a file'foldmarker' 'fmr'markers used when 'foldmethod' is "marker"'foldmethod' 'fdm'folding type'foldminlines' 'fml'minimum number of lines for a fold to be closed'foldnestmax' 'fdn'maximum fold depth'foldopen' 'fdo'for which commands a fold will be opened'foldtext' 'fdt'expression used to display for a closed fold'formatexpr' 'fex'expression used with "gq" command'formatlistpat' 'flp'pattern used to recognize a list header'formatoptions' 'fo'how automatic formatting is to be done'formatprg' 'fp'name of external program used with "gq" command'fsync' 'fs'whether to invoke fsync() after file write'gdefault' 'gd'deprecated, still works — Enables the :substitute "/g" flag by default.'grepformat' 'gfm'format of 'grepprg' output'grepprg' 'gp'program to use for ":grep"'guicursor' 'gcr'GUI: settings for cursor shape and blinking'guifont' 'gfn'GUI: Name(s) of font(s) to be used'guifontwide' 'gfw'list of font names for double-wide characters'guioptions' 'go'GUI: Which components and options are used'guitablabel' 'gtl'GUI: custom label for a tabpage'guitabtooltip' 'gtt'GUI: custom tooltip for a tabpage'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 abandoned'highlight' 'hl'legacy name, still accepted so an old vimrc loads — Names of builtin highlight-groups cannot be changed.'history' 'hi'number of command-lines that are remembered'hkmap' 'hk'legacy name, still accepted so an old vimrc loads — use set keymap=hebrew instead.'hkmapp' 'hkp'legacy name, still accepted so an old vimrc loads — use set keymap=hebrewp instead.'hlsearch' 'hls'highlight matches with last search pattern'icon'let Vim set the text of the window icon'iconstring'string to use for the Vim icon text'ignorecase' 'ic'ignore case in search patterns'imcmdline' 'imc'use IM when starting to edit a command line'imdisable' 'imd'do not use the IM in any mode'iminsert' 'imi'use :lmap or IM in Insert mode'imsearch' 'ims'use :lmap or IM when typing a search pattern'inccommand' 'icm'When nonempty, shows the effects of :substitute, :smagic, :snomagic and user commands with the :command-preview flag as you type.'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'legacy name, still accepted so an old vimrc loads'isfname' 'isf'characters included in file names and pathnames'isident' 'isi'characters included in identifiers'iskeyword' 'isk'characters included in keywords'isprint' 'isp'printable characters'joinspaces' 'js'two spaces after a period with a join command'jumpoptions' 'jop'specifies how jumping is done'keymap' 'kmp'name of a keyboard mapping'keymodel' 'km'enable starting/stopping selection with keys'keywordprg' 'kp'program to use for the "K" command'langmap' 'lmap'alphabetic characters for other language mode'langmenu' 'lm'language to be used for the menus'langnoremap' 'lnr'legacy name, still accepted so an old vimrc loads — Deprecated alias to 'nolangremap'.'langremap' 'lrm'do apply 'langmap' to mapped characters'laststatus' 'ls'tells when last window has status lines'lazyredraw' 'lz'don't redraw while executing macros'lhistory' 'lhi'maximum number of location lists in history'linebreak' 'lbr'wrap long lines at a blank'lines'number of lines in the display'linespace' 'lsp'number of pixel lines to use between characters'lisp'automatic indenting for Lisp'lispoptions' 'lop'changes how Lisp indenting is done'lispwords' 'lw'words that change how lisp indenting works'list'show <Tab> and <EOL>'listchars' 'lcs'characters for displaying in list mode'loadplugins' 'lpl'load plugin scripts when starting up'magic'deprecated, still works — Changes the special characters in search patterns.'makeef' 'mef'name of the errorfile for ":make"'makeencoding' 'menc'encoding of external make/grep commands'makeprg' 'mp'program to use for the ":make" command'matchpairs' 'mps'pairs of characters that "%" can match'matchtime' 'mat'tenths of a second to show matching paren'maxcombine' 'mco'maximum nr of combining characters displayed'maxfuncdepth' 'mfd'maximum recursive depth for user functions'maxmapdepth' 'mmd'maximum recursive depth for mapping'maxmempattern' 'mmp'maximum memory (in Kbyte) used for pattern search'maxsearchcount' 'msc'Maximum number of matches shown for the search count status shm-S When the number of matches exceeds this value, Vim shows ">" instead of the exact count to keep searching fast.'menuitems' 'mis'maximum number of items in a menu'messagesopt' 'mopt'Option settings for outputting messages.'mkspellmem' 'msm'memory used before :mkspell compresses the tree'modeline' 'ml'recognize modelines at start or end of file'modelineexpr' 'mle'allow setting expression options from a modeline'modelines' 'mls'number of lines checked for modelines'modifiable' 'ma'changes to the text are not possible'modified' 'mod'buffer has been modified'more'pause listings when the whole screen is filled'mouse'enable the use of mouse clicks'mousefocus' 'mousef'keyboard focus follows the mouse'mousehide' 'mh'hide mouse pointer while typing'mousemodel' 'mousem'changes meaning of mouse buttons'mousemoveevent' 'mousemev'report mouse moves with <MouseMove>'mousescroll'amount to scroll by when scrolling with a mouse'mouseshape' 'mouses'shape of the mouse pointer in different modes'mousetime' 'mouset'max time between mouse double-click'nrformats' 'nf'number formats recognized 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'packpath' 'pp'list of directories used for packages'paragraphs' 'para'nroff macros that separate paragraphs'paste'legacy name, still accepted so an old vimrc loads — The 'paste' option is obsolete: paste is handled automatically when you paste text using your terminal's or GUI's paste feature (CTRL-SHIFT-v, CMD-v (macOS), middle-click, …).'pastetoggle' 'pt'legacy name, still accepted so an old vimrc loads — paste is handled automatically when'patchexpr' 'pex'expression used to patch a file'patchmode' 'pm'keep the oldest version of a file'path' 'pa'list of directories searched with "gf" et.al.'preserveindent' 'pi'preserve the indent structure when reindenting'previewheight' 'pvh'height of the preview window'previewwindow' 'pvw'identifies the preview window'prompt'legacy name, still accepted so an old vimrc loads'pumblend' 'pb'Enables pseudo-transparency for the popup-menu.'pumborder'Defines the default border style of popupmenu windows.'pumheight' 'ph'maximum number of items to show in the popup menu'pummaxwidth' 'pmw'Maximum width for the popup menu (ins-completion-menu).'pumwidth' 'pw'minimum width of the popup menu'pyxversion' 'pyx'Python version used for pyx* commands'quickfixtextfunc' 'qftf'This option specifies a function to be used to get the text to display in the quickfix and location list windows.'quoteescape' 'qe'escape characters used in a string'readonly' 'ro'disallow writing the buffer'redrawdebug' 'rdb'Flags to change the way redrawing works, for debugging purposes.'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'legacy name, still accepted so an old vimrc loads'report'threshold for reporting nr. of lines changed'revins' 'ri'inserting characters will work backwards'rightleft' 'rl'window is right-to-left oriented'rightleftcmd' 'rlc'commands for which editing works right-to-left'ruler' 'ru'show cursor line and column in the status line'rulerformat' 'ruf'custom format for the ruler'runtimepath' 'rtp'list of directories used for runtime files'scroll' 'scr'lines to scroll with CTRL-U and CTRL-D'scrollback' 'scbk'Maximum number of lines kept beyond the visible screen.'scrollbind' 'scb'scroll in window as other windows scroll'scrolljump' 'sj'minimum number of lines to scroll'scrolloff' 'so'minimum nr. of lines above and below cursor'scrollopt' 'sbo'how 'scrollbind' should behave'sections' 'sect'nroff macros that separate sections'secure'secure mode for reading .vimrc in current dir'selection' 'sel'what type of selection to use'selectmode' 'slm'when to use Select mode instead of Visual mode'sessionoptions' 'ssop'options for :mksession'shada' 'sd'use shada file upon startup and exiting'shadafile' 'sdf'When non-empty, overrides the file name used for shada (viminfo).'shell' 'sh'name of shell to use for external commands'shellcmdflag' 'shcf'flag to shell to execute one command'shellpipe' 'sp'string to put output of ":make" in error file'shellquote' 'shq'quote character(s) for around shell command'shellredir' 'srr'string to put output of filter in a temp file'shellslash' 'ssl'use forward slash for shell file names'shelltemp' 'stmp'whether to use a temp file for shell commands'shellxescape' 'sxe'characters to escape when 'shellxquote' is ('shellxquote' 'sxq'like 'shellquote', but include redirection'shiftround' 'sr'round indent to multiple of shiftwidth'shiftwidth' 'sw'number of spaces to use for (auto)indent step'shortmess' 'shm'list of flags, reduce length of messages'showbreak' 'sbr'string to use at the start of wrapped lines'showcmd' 'sc'show (partial) command somewhere'showcmdloc' 'sloc'where to show (partial) command'showfulltag' 'sft'show full tag pattern when completing tag'showmatch' 'sm'briefly jump to matching bracket if insert one'showmode' 'smd'message on status line to show current mode'showtabline' 'stal'tells when the tabpages line is displayed'sidescroll' 'ss'minimum number of columns to scroll horizontal'sidescrolloff' 'siso'min. nr. of columns to left and right of cursor'signcolumn' 'scl'when and how to display the sign column'smartcase' 'scs'no ignore case when pattern has uppercase'smartindent' 'si'smart autoindenting for C programs'smarttab' 'sta'<Tab> in leading whitespace indents by 'shiftwidth''smoothscroll' 'sms'scroll by screen lines when 'wrap' is set'softtabstop' 'sts'number of columns between two soft tab stops'spell'enable spell checking'spellcapcheck' 'spc'pattern to locate end of a sentence'spellfile' 'spf'files 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'statuscolumn' 'stc'custom format for the status column'statusline' 'stl'custom format for the status line'suffixes' 'su'suffixes that are ignored with multiple match'suffixesadd' 'sua'suffixes added when searching for a file'swapfile' 'swf'whether to use a swapfile for a buffer'switchbuf' 'swb'sets behavior when switching to another buffer'synmaxcol' 'smc'maximum column to find syntax items'syntax' 'syn'syntax to be loaded for current buffer'tabclose' 'tcl'which tabpage to focus when closing a tab'tabline' 'tal'custom format for the console tabpages line'tabpagemax' 'tpm'maximum number of tabpages 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'termbidi' 'tbidi'terminal takes care of bi-directionality'termencoding' 'tenc'legacy name, still accepted so an old vimrc loads — (Vim 7.4.852 also removed this for Windows)'termguicolors' 'tgc'enable 24-bit RGB color in the TUI'termpastefilter' 'tpf'A comma-separated list of options for specifying control characters to be removed from the text pasted into the terminal window.'termsync'If the host terminal supports it, buffer all screen updates made during a redraw cycle so that each screen is displayed in the terminal all at once.'terse'legacy name, still accepted so an old vimrc loads — (Add "s" to 'shortmess' instead)'textwidth' 'tw'maximum width of text that is being inserted'thesaurus' 'tsr'list of thesaurus files for keyword completion'thesaurusfunc' 'tsrfu'function to be used for thesaurus completion'tildeop' 'top'tilde command "~" behaves like an operator'timeout' 'to'time out on mappings and key codes'timeoutlen' 'tm'time out time in milliseconds'title'let Vim set the title of the window'titlelen'percentage of 'columns' used for window title'titleold'old title, restored when exiting'titlestring'string to use for the Vim window title'ttimeout'time out on mappings'ttimeoutlen' 'ttm'time out time for key codes in milliseconds'ttyfast' 'tf'Enables Nvim TUI features which assume a fast (usually local) host terminal.'undodir' 'udir'where to store undo files'undofile' 'udf'save undo information in a file'undolevels' 'ul'maximum number of changes that can be undone'undoreload' 'ur'max nr of lines to save for undo on a buffer reload'updatecount' 'uc'after this many characters flush swap file'updatetime' 'ut'after this many milliseconds flush swap file'varsofttabstop' 'vsts'a list of number of columns between soft tab stops'vartabstop' 'vts'a list of number of columns between tab stops'verbose' 'vbs'give informative messages'verbosefile' 'vfile'file to write messages in'viewdir' 'vdir'directory where to store files with :mkview'viewoptions' 'vop'specifies what to save for :mkview'virtualedit' 've'when to use virtual editing'visualbell' 'vb'use visual bell instead of beeping'warn'warn for shell command when buffer was changed'whichwrap' 'ww'allow specified keys to cross line boundaries'wildchar' 'wc'command-line character for wildcard expansion'wildcharm' 'wcm'like 'wildchar' but also works when mapped'wildignore' 'wig'files matching these patterns are not completed'wildignorecase' 'wic'ignore case when completing file names'wildmenu' 'wmnu'use menu for command line completion'wildmode' 'wim'mode for 'wildchar' command-line expansion'wildoptions' 'wop'specifies how command line completion is done'winaltkeys' 'wak'when the windows system handles ALT keys'winbar' 'wbr'When non-empty, this option enables the window bar and determines its contents.'winblend' 'winbl'Enables pseudo-transparency for a floating window.'winborder'Defines the default border style of floating windows.'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'winhighlight' 'winhl'window-local highlighting'winminheight' 'wmh'minimum number of lines for any window'winminwidth' 'wmw'minimal number of columns for any window'winwidth' 'wiw'minimal number of columns for current window'wrap'long lines wrap and continue on the next line'wrapmargin' 'wm'chars from the right where wrapping starts'wrapscan' 'ws'searches wrap around the end of the file'write'writing to a file is allowed'writeany' 'wa'write to file with no need for "!" override'writebackup' 'wb'make a backup before overwriting a file'writedelay' 'wd'delay this many msec for each char (for debug)Vimscript Functions
464Every built-in, callable from Lua as vim.fn.name()
abs({expr})Return the absolute value of {expr}.acos({expr})Return the arc cosine of {expr} measured in radians, as a Float in the range of [0, pi].add({object}, {expr})Append the item {expr} to List or Blob {object}.and({expr}, {expr})Bitwise AND on the two arguments.api_info()Returns Dictionary of api-metadata.append({lnum}, {text})When {text} is a List:appendbufline({buf}, {lnum}, {text})Like append() but append the text in buffer {buf}.argc([{winid}])The result is the number of files in the argument list.argidx()The result is the current index in the argument list.arglistid([{winnr} [, {tabnr}]])Return the argument list ID.argv([{nr} [, {winid}]])The result is the {nr}th file in the argument list.asin({expr})Return the arc sine of {expr} measured in radians, as a Float in the range of [-pi/2, pi/2].assert_beeps({cmd})Run {cmd} and add an error message to v:errors if it does NOT produce a beep or visual bell.assert_equal({expected}, {actual} [, {msg}])When {expected} and {actual} are not equal an error message is added to v:errors and 1 is returned.assert_equalfile({fname_one}, {fname_two})When the files {fname_one} and {fname_two} do not contain exactly the same text an error message is added to v:errors.assert_exception({error} [, {msg}])When v:exception does not contain the string {error} an error message is added to v:errors.assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]])Run {cmd} and add an error message to v:errors if it does NOT produce an error or when {error} is not found in the error message.assert_false({actual} [, {msg}])When {actual} is not false an error message is added to v:errors, like with assert_equal().assert_inrange({lower}, {upper}, {actual} [, {msg}])This asserts number and Float values.assert_match({pattern}, {actual} [, {msg}])When {pattern} does not match {actual} an error message is added to v:errors.assert_nobeep({cmd})Run {cmd} and add an error message to v:errors if it produces a beep or visual bell.assert_notequal({expected}, {actual} [, {msg}])The opposite of assert_equal():assert_notmatch({pattern}, {actual} [, {msg}])The opposite of assert_match():assert_report({msg})Report a test failure directly, using String {msg}.assert_true({actual} [, {msg}])When {actual} is not true an error message is added to v:errors, like with assert_equal().atan({expr})Return the principal value of the arc tangent of {expr}, in the range [-pi/2, +pi/2] radians, as a Float.atan2({expr1}, {expr2})Return the arc tangent of {expr1} / {expr2}, measured in radians, as a Float in the range [-pi, pi].blob2list({blob})Return a List containing the number value of each byte in Blob {blob}.browse({save}, {title}, {initdir}, {default})Put up a file requester.browsedir({title}, {initdir})Put up a directory requester.bufadd({name})Add a buffer to the buffer list with name {name} (must be a String).bufexists({buf})Checks whether a buffer with the name or number {buf} exists.buffer_exists()Obsolete name for bufexists().buffer_name()Obsolete name for bufname().buffer_number()Obsolete name for bufnr().buflisted({buf})Checks whether a buffer called {buf} exists and is listed (has the 'buflisted' option set).bufload({buf})Ensure the buffer {buf} is loaded.bufloaded({buf})Checks whether a buffer called {buf} exists and is loaded (shown in a window or hidden).bufname([{buf}])The result is the name of a buffer.bufnr([{buf} [, {create}]])The result is the number of a buffer, as it is displayed by the :ls command.bufwinid({buf})Returns the window-ID of the first window associated with buffer {buf}.bufwinnr({buf})Like bufwinid() but returns a window-number instead of a window-ID.byte2line({byte})Return the line number that contains the character at byte count {byte} in the current buffer.byteidx({expr}, {nr} [, {utf16}])Return byte index of the {nr}th character in the String {expr}.byteidxcomp({expr}, {nr} [, {utf16}])Like byteidx(), except that a composing character is counted as a separate character.call({func}, {arglist} [, {dict}]) *E699*Call function {func} with the items in List {arglist} as arguments.ceil({expr})Return the smallest integral value greater than or equal to {expr} as a Float (round up).chanclose({id} [, {stream}])Close a channel or a specific stream associated with it.changenr()Return the number of the most recent change.chansend({id}, {data})Send data to channel {id}.char2nr({string} [, {utf8}])Return Number value of the first char in {string}.charclass({string})Return the character class of the first character in {string}.charcol({expr} [, {winid}])Same as col() but returns the character index of the column position given with {expr} instead of the byte position.charidx({string}, {idx} [, {countcc} [, {utf16}]])Return the character index of the byte at {idx} in {string}.chdir({dir} [, {scope}])Changes the current working directory to {dir}.cindent({lnum})Get the amount of indent for line {lnum} according the C-indenting rules, as with 'cindent'.clearmatches([{win}])Clears all matches previously defined for the current window by matchadd() and the :match commands.cmdcomplete_info()Returns a Dictionary with information about cmdline completion.col({expr} [, {winid}])Returns the byte index of the column position given with {expr}.complete({startcol}, {matches}) *E785*Set the matches for Insert mode completion.complete_add({expr})Add {expr} to the list of matches.complete_check()Check for a key typed while looking for completion matches.complete_info([{what}])Returns a Dictionary with information about Insert mode completion.confirm({msg} [, {choices} [, {default} [, {type}]]])confirm() offers the user a dialog, from which a choice can be made.copy({expr})Make a copy of {expr}.cos({expr})Return the cosine of {expr}, measured in radians, as a Float.cosh({expr})Return the hyperbolic cosine of {expr} as a Float in the range [1, inf].count({comp}, {expr} [, {ic} [, {start}]]) *E706*Return the number of times an item with value {expr} appears in String, List or Dictionary {comp}.ctxget([{index}])Returns a Dictionary representing the context at {index} from the top of the context-stack (see context-dict).ctxpop()Pops and restores the context at the top of the context-stack.ctxpush([{types}])Pushes the current editor state (context) on the context-stack.ctxset({context} [, {index}])Sets the context at {index} from the top of the context-stack to that represented by {context}.ctxsize()Returns the size of the context-stack.cursor({lnum}, {col} [, {off}])Positions the cursor at the column (byte count) {col} in the line {lnum}.debugbreak({pid})Specifically used to interrupt a program being debugged.deepcopy({expr} [, {noref}]) *E698*Make a copy of {expr}.delete({fname} [, {flags}])Without {flags} or with {flags} empty:deletebufline({buf}, {first} [, {last}])Delete lines {first} to {last} (inclusive) from buffer {buf}.dictwatcheradd({dict}, {pattern}, {callback})Adds a watcher to a dictionary.dictwatcherdel({dict}, {pattern}, {callback})Removes a watcher added with dictwatcheradd().did_filetype()Returns TRUE when autocommands are being executed and the FileType event has been triggered at least once.diff_filler({lnum})Returns the number of filler lines above line {lnum}.diff_hlID({lnum}, {col})Returns the highlight ID for diff mode at line {lnum} column {col} (byte index).digraph_get({chars}) *E1214*Return the digraph of {chars}.digraph_getlist([{listall}])Return a list of digraphs.digraph_set({chars}, {digraph})Add digraph {chars} to the list.digraph_setlist({digraphlist})Similar to digraph_set() but this function can add multiple digraphs at once.empty({expr})Return the Number 1 if {expr} is empty, zero otherwise.environ()Return all of environment variables as dictionary.escape({string}, {chars})Escape the characters in {chars} that occur in {string} with a backslash.eval({string})Evaluate {string} and return the result.eventhandler()Returns 1 when inside an event handler.executable({expr})This function checks if an executable with the name {expr} exists.execute({command} [, {silent}])Execute {command} and capture its output.exepath({expr})Returns the full path of {expr} if it is an executable and given as a (partial or full) path or is found in $PATH.exists({expr})Checks whether the expression {expr} is defined.exp({expr})Return the exponential of {expr} as a Float in the range [0, inf].expand({string} [, {nosuf} [, {list}]])Expand wildcards and the following special keywords in {string}.expandcmd({string} [, {options}])Expand special items in String {string} like what is done for an Ex command such as :edit.extend({expr1}, {expr2} [, {expr3}]){expr1} and {expr2} must be both Lists or both Dictionaries.extendnew({expr1}, {expr2} [, {expr3}])Like extend() but instead of adding items to {expr1} a new List or Dictionary is created and returned.feedkeys({string} [, {mode}])Characters in {string} are queued for processing as if they come from a mapping or were typed by the user.file_readable()Obsolete name for filereadable().filecopy({from}, {to})Copy the file pointed to by the name {from} to {to}.filereadable({file})Returns TRUE if {file} exists, can be read, and is not a directory, else FALSE.filewritable({file})Checks whether a file with the name {file} exists and can be written.filter({expr1}, {expr2}){expr1} must be a List, String, Blob or Dictionary.finddir({name} [, {path} [, {count}]])Find directory {name} in {path}.findfile({name} [, {path} [, {count}]])Just like finddir(), but find a file instead of a directory.flatten({list} [, {maxdepth}])Flatten {list} up to {maxdepth} levels.flattennew({list} [, {maxdepth}])Like flatten() but first make a copy of {list}.float2nr({expr})Convert {expr} to a Number by omitting the part after the decimal point.floor({expr})Return the largest integral value less than or equal to {expr} as a Float (round down).fmod({expr1}, {expr2})Return the remainder of {expr1} / {expr2}, even if the division is not representable.fnameescape({string})Escape {string} for use as file name command argument.fnamemodify({fname}, {mods})Modify file name {fname} according to {mods}.foldclosed({lnum})Returns the first line number of the closed fold containing line {lnum}.foldclosedend({lnum})Returns the last line number of the closed fold containing line {lnum}.foldlevel({lnum})Returns the fold nesting level of line {lnum} in the current buffer.foldtext()Returns a String, to be displayed for a closed fold.foldtextresult({lnum})Returns the text that is displayed for the closed fold at line {lnum}.foreach({expr1}, {expr2}){expr1} must be a List, String, Blob or Dictionary.foreground()—fullcommand({name})Get the full command name from a short abbreviated command name; see 20.2 for details on command abbreviations.funcref({name} [, {arglist}] [, {dict}])Just like function(), but the returned Funcref will lookup the function by reference, not by name.function({name} [, {arglist}] [, {dict}]) *partial* *E700* *E923*Return a Funcref variable that refers to function {name}.garbagecollect([{atexit}])Cleanup unused Lists and Dictionaries that have circular references.get({list}, {idx} [, {default}]) *get()-list*Get item {idx} from List {list}.getbufinfo([{buf}])Get information about buffers as a List of Dictionaries.getbufline({buf}, {lnum} [, {end}])Return a List with the lines starting from {lnum} to {end} (inclusive) in the buffer {buf}.getbufoneline({buf}, {lnum})Just like getbufline() but only get one line and return it as a string.getbufvar({buf}, {varname} [, {def}])The result is the value of option or local buffer variable {varname} in buffer {buf}.getcellwidths()Returns a List of cell widths of character ranges overridden by setcellwidths().getchangelist([{buf}])Returns the changelist for the buffer {buf}.getchar([{expr} [, {opts}]])Get a single character from the user or input stream.getcharmod()Returns the state of the keyboard modifiers for the last character obtained with getchar() or in another way.getcharpos({expr})Get the position for String {expr}.getcharsearch()Return the current character search information as a {dict} with the following entries:getcharstr([{expr} [, {opts}]])The same as getchar(), except that this always returns a String, and "number" isn't allowed in {opts}.getcmdcomplpat()Return completion pattern of the current command-line.getcmdcompltype()Return the type of the current command-line completion.getcmdline()Return the current command-line input.getcmdpos()Return the position of the cursor in the command line as a byte count.getcmdprompt()Return the current command-line prompt when using functions like input() or confirm().getcmdscreenpos()Return the screen position of the cursor in the command line as a byte count.getcmdtype()Return the current command-line type.getcmdwintype()Return the current command-line-window type.getcompletion({pat}, {type} [, {filtered}])Return a list of command-line completion matches.getcompletiontype({pat})Return the type of the command-line completion using {pat}.getcurpos([{winid}])Get the position of the cursor.getcursorcharpos([{winid}])Same as getcurpos() but the column number in the returned List is a character index instead of a byte index.getcwd([{winnr} [, {tabnr}]])With no arguments, returns the name of the effective current-directory.getenv({name})Return the value of environment variable {name}.getfontname([{name}])Without an argument returns the name of the normal font being used.getfperm({fname})Returns the file permissions of the given file {fname} as a String.getfsize({fname})Returns the size in bytes of the given file {fname}.getftime({fname})Returns the last modification time ("mtime") of file {fname}.getftype({fname})Returns a description of the type of file {fname} as a String.getjumplist([{winnr} [, {tabnr}]])Returns the jumplist for the specified window.getline({lnum} [, {end}])Without {end} the result is a String, which is line {lnum} from the current buffer.getloclist({nr} [, {what}])Returns a List with all the entries in the location list for window {nr} (window-number or window-ID).getmarklist([{buf}])Without the {buf} argument returns a List with information about all the global marks.getmatches([{win}])Returns a List with all matches previously defined for the current window by matchadd() and the :match commands.getmousepos()Returns a Dictionary with the last known position of the mouse.getpid()Return a Number which is the process ID of the Vim process.getpos({expr})Gets a position, where {expr} is one of:getqflist([{what}])Returns a List with all the current quickfix errors.getreg([{regname} [, 1 [, {list}]]])Returns the contents of register {regname} as a String.getreginfo([{regname}])Returns detailed information about register {regname} as a Dictionary with the following entries:getregion({pos1}, {pos2} [, {opts}])Returns the list of strings from {pos1} to {pos2} from a buffer.getregionpos({pos1}, {pos2} [, {opts}])Same as getregion(), but returns a list of positions describing the buffer text segments bound by {pos1} and {pos2}.getregtype([{regname}])Returns the type of register {regname} as a String.getscriptinfo([{opts}])Returns a List with information about all the sourced Vim scripts in the order they were sourced, like what :scriptnames shows.getstacktrace()Returns the current stack trace of Vim scripts.gettabinfo([{tabnr}])If {tabnr} is not specified, then information about all the tabpages is returned as a List.gettabvar({tabnr}, {varname} [, {def}])Get the value of a tab-local variable {varname} in tabpage {tabnr}.gettabwinvar({tabnr}, {winnr}, {varname} [, {def}])Get the value of window-local variable {varname} in window {winnr} in tabpage {tabnr}.gettagstack([{winnr}])Returns the tag stack of window {winnr} (window-number or window-ID) as a Dict.gettext({text})Translate String {text} if possible.getwininfo([{winid}])Returns information about windows as a List with Dictionaries.getwinpos([{timeout}])Returns the [x, y] screen position of the Nvim GUI window as a List with two numbers (result of getwinposx() and getwinposy() combined).getwinposx()Returns the X coordinate in pixels of the left hand side of the Nvim GUI window, or -1 if not available.getwinposy()Returns the Y coordinate in pixels of the top of the Nvim GUI window, or -1 if not available.getwinvar({winnr}, {varname} [, {def}])Like gettabwinvar() for the current tabpage.glob({expr} [, {nosuf} [, {list} [, {alllinks}]]])Expand the file wildcards in {expr}.glob2regpat({string})Convert a file pattern, as used by glob(), into a search pattern.globpath({path}, {expr} [, {nosuf} [, {list} [, {allinks}]]])Perform glob() for String {expr} on all directories in {path} and concatenate the results.has({feature})Returns 1 if {feature} is supported, 0 otherwise.has_key({dict}, {key})Checks whether Dictionary {dict} has an entry with key {key}.haslocaldir([{winnr} [, {tabnr}]])Checks whether the window or tabpage has set a local working directory.hasmapto({what} [, {mode} [, {abbr}]])Checks whether a mapping exists whose rhs contains {what}.highlightID()Obsolete name for hlID().highlight_exists()Obsolete name for hlexists().histadd({history}, {item})Add the String {item} to the history {history} which can be one of:histdel({history} [, {item}])Clear {history}, i.e. delete all its entries. See hist-names for the possible values of {history}.histget({history} [, {index}])Returns an entry from the specified command-line {history}.histnr({history})The result is the Number of the current entry in {history}.hlID({name})Returns the numeric ID of the highlight group with name {name}.hlexists({name})Checks whether a highlight group called {name} exists.hostname()Returns the hostname of the machine on which the Nvim server (not the UI client) is currently running.iconv({string}, {from}, {to})Converts the encoding of {string} from {from} to {to}.id({expr})Returns a String which is a unique identifier of the container type (List, Dict, Blob and Partial).indent({lnum})Returns the indent of line {lnum} in the current buffer.index({object}, {expr} [, {start} [, {ic}]])Find {expr} in {object} and return its index.indexof({object}, {expr} [, {opts}])Returns the index of an item in {object} where {expr} is v:true.input({prompt} [, {text} [, {completion}]])Prompts the user to enter text on the command-line, and returns the text as a String.inputdialog()Use input() instead.inputlist({textlist})Displays a list of strings and prompts the user to select one by entering a number.inputrestore()Restore typeahead that was saved with a previous inputsave().inputsave()Preserve typeahead (also from mappings) and clear it, so that a following prompt gets input from the user.inputsecret({prompt} [, {text}])This function acts much like the input() function with but two exceptions:insert({object}, {item} [, {idx}])When {object} is a List or a Blob insert {item} at the start of it.interrupt()Interrupt script execution.invert({expr})Bitwise invert.isabsolutepath({path})Checks whether {path} is an absolute path.isdirectory({directory})Returns TRUE if {directory} exists, or FALSE if it doesn't exist or isn't a directory.isinf({expr})Return 1 if {expr} is a positive infinity, or -1 a negative infinity, otherwise 0. >vim echo isinf(1.0 / 0.0)islocked({expr}) *E786*Returns TRUE if {expr} is the name of a locked variable, else FALSE.isnan({expr})Return TRUE if {expr} is a float with value NaN.items({expr})Return a List with all key/index and value pairs of {expr}.jobclose()Obsolete name for chanclose()jobpid({job})Return the PID (process id) of job-id {job}.jobresize({job}, {width}, {height})Resize the pseudo terminal window of job-id {job} to {width} columns and {height} rows.jobsend()Obsolete name for chansend()jobstart({cmd} [, {opts}])Spawns {cmd} as a job.jobstop({id})Stop job-id {id} by sending SIGTERM to the job process.jobwait({jobs} [, {timeout}])Waits for jobs and their on_exit handlers to complete.join({list} [, {sep}])Join the items in {list} together into one String.json_decode({expr})Convert {expr} from JSON object.json_encode({expr})Convert {expr} into a JSON string.keys({dict})Return a List with all the keys of {dict}.keytrans({string})Turn the internal byte representation of keys into a form that can be used for :map.last_buffer_nr()Obsolete name for bufnr("$").len({expr}) *E701*Returns the length of the argument.libcall({libname}, {funcname}, {argument}) *E364* *E368*Call function {funcname} in the run-time library {libname} with single argument {argument}.libcallnr({libname}, {funcname}, {argument})Just like libcall(), but used for a function that returns an int instead of a string.line({expr} [, {winid}])See getpos() for accepted positions.line2byte({lnum})Return the byte count from the start of the buffer for line {lnum}.lispindent({lnum})Get the amount of indent for line {lnum} according the lisp indenting rules, as with 'lisp'.list2blob({list})Return a Blob concatenating all the number values in {list}.list2str({list} [, {utf8}])Convert each number in {list} to a character string can concatenate them all.localtime()Return the current time, measured as seconds since 1st Jan 1970. See also strftime(), strptime() and getftime().log({expr})Return the natural logarithm (base e) of {expr} as a Float.log10({expr})Return the logarithm of Float {expr} to base 10 as a Float.luaeval({expr} [, {expr}])Evaluate Lua expression {expr} and return its result converted to Vim data structures.map({expr1}, {expr2}){expr1} must be a List, String, Blob or Dictionary.maparg({name} [, {mode} [, {abbr} [, {dict}]]])When {dict} is omitted or zero:mapcheck({name} [, {mode} [, {abbr}]])Check if there is a mapping that matches with {name} in mode {mode}.maplist([{abbr}])Returns a List of all mappings.mapnew({expr1}, {expr2})Like map() but instead of replacing items in {expr1} a new List or Dictionary is created and returned.mapset({mode}, {abbr}, {dict})Restore a mapping from a dictionary, possibly returned by maparg() or maplist().match({expr}, {pat} [, {start} [, {count}]])When {expr} is a List then this returns the index of the first item where {pat} matches.matchadd()Defines a pattern to be highlighted in the current window (a "match").matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]])Same as matchadd(), but requires a list of positions {pos} instead of a pattern.matcharg({nr})Selects the {nr} match item, as set with a :match, :2match or :3match command.matchbufline({buf}, {pat}, {lnum}, {end}, [, {dict}])Returns the List of matches in lines from {lnum} to {end} in buffer {buf} where {pat} matches.matchdelete({id} [, {win}]) *E802* *E803*Deletes a match with ID {id} previously defined by matchadd() or one of the :match commands.matchend({expr}, {pat} [, {start} [, {count}]])Same as match(), but return the index of first character after the match.matchfuzzy({list}, {str} [, {dict}])If {list} is a list of strings, then returns a List with all the strings in {list} that fuzzy match {str}.matchfuzzypos({list}, {str} [, {dict}])Same as matchfuzzy(), but returns the list of matched strings, the list of character positions where characters in {str} matches and a list of matching scores.matchlist({expr}, {pat} [, {start} [, {count}]])Same as match(), but return a List.matchstr({expr}, {pat} [, {start} [, {count}]])Same as match(), but return the matched string.matchstrlist({list}, {pat} [, {dict}])Returns the List of matches in {list} where {pat} matches.matchstrpos({expr}, {pat} [, {start} [, {count}]])Same as matchstr(), but return the matched string, the start position and the end position of the match.max({expr})Return the maximum value of all items in {expr}.menu_get({path} [, {modes}])Returns a List of Dictionaries describing menus (defined by :menu, :amenu, …), including hidden-menus.menu_info({name} [, {mode}])Return information about the specified menu {name} in mode {mode}.min({expr})Return the minimum value of all items in {expr}.mkdir({name} [, {flags} [, {prot}]]) *E739*Create directory {name}.mode([{expr}])Return a string that indicates the current mode.msgpackdump({list} [, {type}])Convert a list of Vimscript objects to msgpack.msgpackparse({data})Convert a readfile()-style list or a Blob to a list of Vimscript objects.nextnonblank({lnum})Return the line number of the first line at or below {lnum} that is not blank.nr2char({expr} [, {utf8}])Return a string with a single character, which has the number value {expr}.or({expr}, {expr})Bitwise OR on the two arguments.pathshorten({path} [, {len}])Shorten directory names in the path {path} and return the result.perleval({expr})Evaluate perl expression {expr} and return its result converted to Vim data structures.pow({x}, {y})Return the power of {x} to the exponent {y} as a Float.preinserted()Returns non-zero if text has been inserted after the cursor because "preinsert" is present in 'completeopt', or because "longest" is present in 'completeopt' while 'autocomplete' is active.prevnonblank({lnum})Return the line number of the first line at or above {lnum} that is not blank.printf({fmt}, {expr1} ...)Return a String with {fmt}, where "%" items are replaced by the formatted form of their respective arguments.prompt_appendbuf({buf}, {text})Appends text to prompt buffer before current prompt.prompt_getinput({buf})Gets the current user-input in prompt-buffer {buf} without invoking prompt_callback.prompt_getprompt({buf})Returns the effective prompt text for buffer {buf}.prompt_setcallback({buf}, {expr})Set prompt callback for buffer {buf} to {expr}.prompt_setinterrupt({buf}, {expr})Set a callback for buffer {buf} to {expr}.prompt_setprompt({buf}, {text})Set prompt for buffer {buf} to {text}.pum_getpos()If the popup menu (see ins-completion-menu) is not visible, returns an empty Dictionary, otherwise, returns a Dictionary with the following keys:pumvisible()Returns non-zero when the popup menu is visible, zero otherwise.py3eval({expr})Evaluate Python expression {expr} and return its result converted to Vim data structures.pyeval({expr}) *E858* *E859*Evaluate Python expression {expr} and return its result converted to Vim data structures.pyxeval({expr})Evaluate Python expression {expr} and return its result converted to Vim data structures.rand([{expr}])Return a pseudo-random Number generated with an xoshiro128** algorithm using seed {expr}.range({expr} [, {max} [, {stride}]]) *E726* *E727*Returns a List with Numbers:readblob({fname} [, {offset} [, {size}]])Read file {fname} in binary mode and return a Blob.readdir({directory} [, {expr}])Return a list with file and directory names in {directory}.readfile({fname} [, {type} [, {max}]])Read file {fname} and return a List, each line of the file as an item.reduce({object}, {func} [, {initial}]) *E998*{func} is called for every item in {object}, which can be a String, List or a Blob.reg_executing()Returns the single letter name of the register being executed.reg_recorded()Returns the single letter name of the last recorded register.reg_recording()Returns the single letter name of the register being recorded.reltime()Return an item that represents a time value.reltimefloat({time})Return a Float that represents the time value of {time}.reltimestr({time})Return a String that represents the time value of {time}.remove({list}, {idx})Without {end}:rename({from}, {to})Rename the file by the name {from} to the name {to}.repeat({expr}, {count})Repeat {expr} {count} times and return the concatenated result.resolve({filename}) *E655*On MS-Windows, when {filename} is a shortcut (a .lnk file), returns the path the shortcut points to in a simplified form.reverse({object})Reverse the order of items in {object}.round({expr})Round off {expr} to the nearest integral value and return it as a Float.rpcnotify({channel}, {event} [, {args}...])Sends {event} to {channel} via RPC and returns immediately.rpcrequest({channel}, {method} [, {args}...])Sends a request to {channel} to invoke {method} via RPC and blocks until a response is received.rpcstart()Use jobstart() with {'rpc': v:true} instead.rpcstop()Use jobstop() instead to stop any job, or chanclose(id, "rpc") to close RPC communication without stopping the job. Use chanclose(id) to close any socket.rubyeval({expr})Evaluate Ruby expression {expr} and return its result converted to Vim data structures.screenattr({row}, {col})Like screenchar(), but return the attribute.screenchar({row}, {col})Returns the character at screen position [row, col] as a Number.screenchars({row}, {col})Returns the character and any composing characters at screen position [row, col] as a List of Numbers.screencol()Returns the current screen column of the cursor.screenpos({winid}, {lnum}, {col})Returns the screen position of the text character in window {winid} at buffer line {lnum} and column {col} as a Dict.screenrow()Returns the current screen row of the cursor.screenstring({row}, {col})Returns the base character and any composing characters at screen position [row, col] as a String.search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])Search for regexp pattern {pattern}.searchcount([{options}])Get or update the last search count, like what is displayed without the "S" flag in 'shortmess'.searchdecl({name} [, {global} [, {thisblock}]])Search for the declaration of {name}.searchpair({start}, {middle}, {end} [, {flags} [, {skip} [, {stopline} [, {timeout}]]]])Search for the match of a nested start-end pair.searchpairpos({start}, {middle}, {end} [, {flags} [, {skip} [, {stopline} [, {timeout}]]]])Same as searchpair(), but returns a List with the line and column position of the match.searchpos({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])Same as search(), but returns a List with the line and column position of the match.serverlist([{opts}])Returns a list of server addresses, or empty if all servers were stopped.serverstart([{address}])Opens a socket or named pipe at {address} and listens for RPC messages.serverstop({address})Closes the pipe or socket at {address}.setbufline({buf}, {lnum}, {text})Set line {lnum} to {text} in buffer {buf}.setbufvar({buf}, {varname}, {val})Set option or local variable {varname} in buffer {buf} to {val}.setcellwidths({list})Specify overrides for cell widths of character ranges.setcharpos({expr}, {list})Same as setpos() but uses the specified column number as the character index instead of the byte index in the line.setcharsearch({dict})Set the current character search information to {dict}, which contains one or more of the following entries:setcmdline({str} [, {pos}])Set the command line to {str} and set the cursor position to {pos}.setcmdpos({pos})Set the cursor position in the command line to byte position {pos}.setcursorcharpos({lnum}, {col} [, {off}])Same as cursor() but uses the specified column number as the character index instead of the byte index in the line.setenv({name}, {val})Set environment variable {name} to {val}.setfperm({fname}, {mode}) *chmod*Set the file permissions for {fname} to {mode}.setline({lnum}, {text})Set line {lnum} of the current buffer to {text}.setloclist({nr}, {list} [, {action} [, {what}]])Create or replace or add to the location list for window {nr} (window-number or window-ID).setmatches({list} [, {win}])Restores a list of matches saved by getmatches() for the current window.setpos({expr}, {list})Set the position for String {expr}.setqflist({list} [, {action} [, {what}]])Create or replace or add to the quickfix list.setreg({regname}, {value} [, {options}])Set the register {regname} to {value}.settabvar({tabnr}, {varname}, {val})Set tab-local variable {varname} to {val} in tabpage {tabnr}.settabwinvar({tabnr}, {winnr}, {varname}, {val})Set option or local variable {varname} in window {winnr} to {val}.settagstack({nr}, {dict} [, {action}])Modify the tag stack of the window {nr} (window-number or window-ID) using {dict}.setwinvar({nr}, {varname}, {val})Like settabwinvar() for the current tabpage.sha256({expr})Returns a String with 64 hex characters, which is the SHA256 checksum of {expr}.shellescape({string} [, {special}])Escape {string} for use as a shell command argument.shiftwidth([{col}])Returns the effective value of 'shiftwidth'.sign_define({name} [, {dict}])Define a new sign named {name} or modify the attributes of an existing sign.sign_getdefined([{name}])Get a list of defined signs and their attributes.sign_getplaced([{buf} [, {dict}]])Return a list of signs placed in a buffer or all the buffers.sign_jump({id}, {group}, {buf})Open the buffer {buf} or jump to the window that contains {buf} and position the cursor at sign {id} in group {group}.sign_place({id}, {group}, {name}, {buf} [, {dict}])Place the sign defined as {name} at line {lnum} in file or buffer {buf} and assign {id} and {group} to sign.sign_placelist({list})Place one or more signs.sign_undefine([{name}])Deletes a previously defined sign {name}.sign_unplace({group} [, {dict}])Remove a previously placed sign in one or more buffers.sign_unplacelist({list})Remove previously placed signs from one or more buffers.simplify({filename})Simplify the file name as much as possible without changing the meaning.sin({expr})Return the sine of {expr}, measured in radians, as a Float.sinh({expr})Return the hyperbolic sine of {expr} as a Float in the range [-inf, inf].slice({expr}, {start} [, {end}])Similar to using a slice "expr[start :sockconnect({mode}, {address} [, {opts}])Connect a socket to an address.sort({list} [, {how} [, {dict}]]) *E702*Sort the items in {list} in-place.soundfold({word})Return the sound-folded equivalent of {word}.spellbadword([{sentence}])Without argument:spellsuggest({word} [, {max} [, {capital}]])Return a List with spelling suggestions to replace {word}.split({string} [, {pattern} [, {keepempty}]])Make a List out of {string}.sqrt({expr})Return the non-negative square root of Float {expr} as a Float.srand([{expr}])Initialize seed used by rand():state([{what}])Return a string which contains characters indicating the current state.stdioopen({opts})With --headless this opens stdin and stdout as a channel.stdpath({what}) *E6100*Returns standard-path locations of various default files and directories.str2float({string} [, {quoted}])Convert String {string} to a Float.str2list({string} [, {utf8}])Return a list containing the number values which represent each character in String {string}.str2nr({string} [, {base}])Convert string {string} to a number.strcharlen({string})Returns the number of characters in String {string}, ignoring composing characters.strcharpart({src}, {start} [, {len} [, {skipcc}]])Like strpart() but using character index and length instead of byte index and length.strchars({string} [, {skipcc}])Returns the number of characters in String {string}.strdisplaywidth({string} [, {col}])Returns the number of display cells String {string} occupies on the screen when it starts at {col} (first column is zero).strftime({format} [, {time}])Formats a date and time String specified by {format}.strgetchar({str}, {index})Get a Number corresponding to the character at {index} in {str}.stridx({haystack}, {needle} [, {start}])Returns the byte index of the first occurrence of {needle} in {haystack}.string({expr})Converts {expr} to a String.strlen({string})Returns the length of String {string} in bytes.strpart({src}, {start} [, {len} [, {chars}]])Gets a substring from {src}, starting from byte {start}, with byte length {len}.strptime({format}, {timestring})Parses a date/time string and returns a unix timestamp.strridx({haystack}, {needle} [, {start}])Returns the byte index of the last occurrence of {needle} in {haystack}.strtrans({string})Translates all unprintable characters in {string} into printable characters 'isprint', like they are shown in a window.strutf16len({string} [, {countcc}])Returns the number of UTF-16 code units in String {string} (after converting it to UTF-16).strwidth({string})Returns the number of display cells String {string} occupies.submatch({nr} [, {list}]) *E935*Only for an expression in a :substitute command or substitute() function.substitute({string}, {pat}, {sub}, {flags})Performs string substitution.swapfilelist()Returns a list of swap file names, like what "vim -r" shows.swapinfo({fname})Returns information about the swapfile {fname} as a dictionary.swapname({buf})The result is the swap file path of the buffer {buf}.synID({lnum}, {col}, {trans})Returns the syntax ID at position {lnum} and {col} in the current window.synIDattr({synID}, {what} [, {mode}])Returns the {what} attribute of syntax ID {synID} as a String.synIDtrans({synID})Returns the translated syntax ID of {synID}, following highlight links.synconcealed({lnum}, {col})Returns conceal information for the character at position {lnum} and {col} as a List with three items:synstack({lnum}, {col})Return a List, which is the stack of syntax items at the position {lnum} and {col} in the current window.system({cmd} [, {input}]) *E677*Gets the output of {cmd} as a string (systemlist() returns a List) and sets v:shell_error to the error code.systemlist({cmd} [, {input} [, {keepempty}]])Same as system(), but returns a List with lines (parts of output separated by NL) with NULs transformed into NLs.tabpagebuflist([{arg}])Returns a List of buffer numbers, one for each window in the specified tabpage.tabpagenr([{arg}])Returns the current tabpage-number.tabpagewinnr({tabarg} [, {arg}])Like winnr() but for tabpage {tabarg}.tagfiles()Returns a List with the file names used to search for tags for the current buffer.taglist({expr} [, {filename}])Returns a List of tags matching the regular expression {expr}.tan({expr})Return the tangent of {expr}, measured in radians, as a Float in the range [-inf, inf].tanh({expr})Return the hyperbolic tangent of {expr} as a Float in the range [-1, 1].tempname()Generates a (non-existent) filename located in the Nvim root tempdir.termopen()Use jobstart() with {term: v:true}.timer_info([{id}])Return a list with information about timers.timer_pause({timer}, {paused})Pause or unpause a timer.timer_start({time}, {callback} [, {options}]) *timer*Create a timer and return the timer ID.timer_stop({timer})Stop a timer.timer_stopall()Stop all timers.tolower({expr})Converts a String to lowercase (like applying gu).toupper({expr})Converts a String to uppercase (like applying gU).tr({src}, {fromstr}, {tostr})Translates characters in {src}, replacing each character that appears in {fromstr} with the corresponding character in {tostr}.trim({text} [, {mask} [, {dir}]])Return {text} as a String where any character in {mask} is removed from the beginning and/or end of {text}.trunc({expr})Return the largest integral value with magnitude less than or equal to {expr} as a Float (truncate towards zero).type({expr})Returns the type of {expr} as a Number.undofile({name})Return the name of the undo file that would be used for a file with name {name} when writing.undotree([{buf}])Return the current state of the undo tree for the current buffer, or for a specific buffer if {buf} is given.uniq({list} [, {func} [, {dict}]]) *E882*Remove second and succeeding copies of repeated adjacent {list} items in-place.utf16idx({string}, {idx} [, {countcc} [, {charidx}]])Same as charidx() but returns the UTF-16 code unit index of the byte at {idx} in {string} (after converting it to UTF-16).values({dict})Return a List with all the values of {dict}.virtcol({expr} [, {list} [, {winid}]])Returns the virtual (screen) column of the file position given with {expr}.virtcol2col({winid}, {lnum}, {col})Converts a virtual column to a byte index.visualmode([{expr}])Returns a String describing the last Visual mode used in the current buffer.wait({timeout}, {condition} [, {interval}])Waits until {condition} evaluates to TRUE, where {condition} is a Funcref or string containing an expression.wildmenumode()Returns TRUE when the wildmenu is active and FALSE otherwise.wildtrigger()Start wildcard expansion in the command-line, using the behavior defined by the 'wildmode' and 'wildoptions' settings.win_execute({id}, {command} [, {silent}])Like execute() but in the context of window {id}.win_findbuf({bufnr})Returns a List with window-IDs for windows that contain buffer {bufnr}.win_getid([{win} [, {tab}]])Get the window-ID for the specified window.win_gettype([{nr}])Return the type of the window:win_gotoid({expr})Go to window-ID {expr}.win_id2tabwin({expr})Return [tabnr, winnr] for window with window-ID {expr}, where tabnr is the tabpage-number and winnr is the window-number.win_id2win({expr})Return the window-number of for the given window-ID {expr}.win_move_separator({nr}, {offset})Move window {nr}'s vertical separator (i.e., the right border) by {offset} columns, as if being dragged by the mouse.win_move_statusline({nr}, {offset})Move window {nr}'s status line (i.e., the bottom border) by {offset} rows, as if being dragged by the mouse.win_screenpos({nr})Return the screen position of window {nr} as a list with two numbers:win_splitmove({nr}, {target} [, {options}])Temporarily switch to window {target}, then move window {nr} to a new split adjacent to {target}.winbufnr({nr})Returns the buffer number associated with window {nr} (window-number or window-ID).wincol()Returns the virtual column of the cursor in the window.windowsversion()Returns the Windows OS version as a String.winheight({nr})Gets the height of window-ID {nr} (zero for "current window"), excluding any 'winbar' and 'statusline'.winlayout([{tabnr}])Returns the layout of windows in a tabpage as a nested List.winline()Returns the screen line of the cursor in the window.winnr([{arg}])Returns the number of the current window.winrestcmd()Returns a sequence of :resize commands that should restore the current window sizes.winrestview({dict})Uses the Dictionary returned by winsaveview() to restore the view of the current window.winsaveview()Returns a Dictionary that contains information to restore the view of the current window.winwidth({nr})Gets the width of window-ID {nr} (zero for "current window"), including columns (sign-column, 'statuscolumn', etc.).wordcount()Returns a dictionary of byte/chars/word statistics for the current buffer.writefile({data}, {fname} [, {flags}])Writes {data} to file {fname}.xor({expr}, {expr})Bitwise XOR on the two arguments.Autocommand Events
145Every event :autocmd and nvim_create_autocmd() can hook
BufAddAfter adding a new buffer or existing unlisted buffer to the buffer list (except during startup, see VimEnter), or renaming a listed buffer.BufCreateUse BufAdd instead.BufDeleteBefore deleting a buffer from the buffer list.BufEnterAfter entering (visiting, switching-to) a new or existing buffer.BufFilePostAfter changing the name of the current buffer with the ":file" or ":saveas" command.BufFilePreBefore changing the name of the current buffer with the ":file" or ":saveas" command.BufHiddenBefore a buffer becomes hidden:BufLeaveBefore leaving to another buffer.BufModifiedSetAfter the 'modified' value of a buffer has been changed.BufNewAfter creating a new buffer (except during startup, see VimEnter) or renaming an existing buffer.BufNewFileWhen starting to edit a file that doesn't exist.BufReadWhen starting to edit a new buffer, after reading the file into the buffer, before processing modelines.BufReadCmdBefore starting to edit a new buffer.BufReadPostWhen starting to edit a new buffer, after reading the file into the buffer, before processing modelines.BufReadPreWhen starting to edit a new buffer, before reading the file into the buffer.BufUnloadBefore unloading a buffer, when the text in the buffer is going to be freed.BufWinEnterAfter a buffer is displayed in a window.BufWinLeaveBefore a buffer is removed from a window.BufWipeoutBefore completely deleting a buffer.BufWriteBefore writing the whole buffer to a file.BufWriteCmdBefore writing the whole buffer to a file.BufWritePostAfter writing the whole buffer to a file (should undo the commands for BufWritePre).BufWritePreBefore writing the whole buffer to a file.ChanInfoState of channel changed, for instance the client of a RPC channel described itself.ChanOpenJust after a channel was opened.CmdUndefinedWhen a user command is used but it isn't defined.CmdlineChangedAfter EVERY change inside command line.CmdlineEnterAfter entering the command-line (including non-interactive use of ":" in a mapping:CmdlineLeaveBefore leaving the command-line (including non-interactive use of ":" in a mapping:CmdlineLeavePreJust before leaving the command line, and before CmdlineLeave.CmdwinEnterAfter entering the command-line window.CmdwinLeaveBefore leaving the command-line window.ColorSchemeAfter loading a color scheme.ColorSchemePreBefore loading a color scheme.CompleteChangedAfter each time the Insert mode completion menu changed.CompleteDoneAfter Insert mode completion is done.CompleteDonePreAfter Insert mode completion is done.CursorHoldWhen there is no user input for 'updatetime' duration, in Normal-mode.CursorHoldILike CursorHold, but in Insert mode.CursorMovedAfter the cursor was moved in Normal or Visual mode or to another window.CursorMovedCAfter the cursor was moved in the command line.CursorMovedIAfter the cursor was moved in Insert mode.DiagnosticChangedAfter diagnostics have changed.DiffUpdatedAfter diffs have been updated.DirChangedAfter the current-directory was changed.DirChangedPreWhen the current-directory is going to be changed, as with DirChanged.EncodingChangedNever fired; 'encoding' is always "utf-8".ExitPreWhen using :quit, :wq in a way it makes Vim exit, or using :qall, just after QuitPre.FileAppendCmdBefore appending to a file.FileAppendPostAfter appending to a file.FileAppendPreBefore appending to a file.FileChangedROBefore making the first change to a read-only file.FileChangedShellWhen Vim notices that the modification time of a file has changed since editing started.FileChangedShellPostAfter handling a file that was changed outside of Vim.FileEncodingNever fired; equivalent to EncodingChanged.FileReadCmdBefore 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.FileWriteCmdBefore writing to a file, when not writing the whole buffer.FileWritePostAfter writing to a file, when not writing the whole buffer.FileWritePreBefore writing to a file, when not writing the whole buffer.FilterReadPostAfter reading a file from a filter command.FilterReadPreBefore reading a file from a filter command.FilterWritePostAfter writing a file for a filter command or making a diff with an external diff (see DiffUpdated for internal diff).FilterWritePreBefore writing a file for a filter command or making a diff with an external diff.FocusGainedNvim got focus.FocusLostNvim lost focus.FuncUndefinedWhen a user function is used but it isn't defined.GUIEnterNever fired; use UIEnter instead.GUIFailedNever fired.InsertChangeWhen typing <Insert> while in Insert or Replace mode.InsertCharPreWhen a character is typed in Insert mode, before inserting the char.InsertEnterJust before starting Insert mode.InsertLeaveJust after leaving Insert mode.InsertLeavePreJust before leaving Insert mode.LspAttachAfter an LSP client performs "initialize" and attaches to a buffer.LspDetachJust before an LSP client detaches from a buffer.LspNotifyThis event is triggered after each successful notification sent to an LSP server.LspProgressUpon receipt of a progress notification from the server.LspRequestFor each request sent to an LSP server, this event is triggered for every change to the request's status.LspTokenUpdateWhen a visible semantic token is sent or updated by the LSP server, or when an existing token becomes visible for the first time.MarkSetAfter a mark is set by m, :mark, and nvim_buf_set_mark(), or deleted by :delmarks and nvim_buf_del_mark().MenuPopupJust before showing the popup menu (under the right mouse button).ModeChangedAfter changing the mode.OptionSetAfter setting an option (except during startup).PackChangedAfter plugin's state has changed.PackChangedPreBefore trying to change plugin's state.ProgressAfter a progress-message is created or updated via nvim_echo.QuickFixCmdPostLike QuickFixCmdPre, but after a quickfix command is run, before jumping to the first location.QuickFixCmdPreBefore a quickfix command is run (:make, :lmake, :grep, :lgrep, :grepadd, :lgrepadd, :vimgrep, :lvimgrep, :vimgrepadd, :lvimgrepadd, :cfile, :cgetfile, :caddfile, :lfile, :lgetfile, :laddfile, :helpgrep,QuitPreWhen using :quit, :wq or :qall, before deciding whether it closes the current window or quits Vim.RecordingEnterWhen a macro starts recording.RecordingLeaveWhen a macro stops recording.RemoteReplyWhen a reply from a Vim that functions as server was received server2client().SafeStateWhen nothing is pending, going to wait for the user to type a character.SearchWrappedAfter making a search with n or N if the search wraps around the document back to the start/finish respectively.SessionLoadPostAfter loading the session file created using the :mksession command.SessionLoadPreBefore loading the session file created using the :mksession command.SessionWritePostAfter writing a session file by calling the :mksession command.ShellCmdPostAfter executing a shell command with :!cmd, :make and :grep.ShellFilterPostAfter executing a shell command with ":{range}!cmd", ":w !cmd" or ":r !cmd".SignalAfter Nvim receives a signal.SourceCmdWhen sourcing a Vimscript/Lua file.SourcePostAfter sourcing a Vimscript/Lua file.SourcePreBefore sourcing a Vimscript/Lua file.SpellFileMissingWhen trying to load a spell checking file and it can't be found.StdinReadPostDuring startup, after reading from stdin into the buffer, before executing modelines.StdinReadPreDuring startup, before reading from stdin into the buffer.SwapExistsDetected an existing swap file when starting to edit a file.SyntaxWhen the 'syntax' option has been set.TabClosedAfter closing a tabpage.TabClosedPreBefore closing a tabpage.TabEnterJust after entering a tabpage.TabLeaveJust before leaving a tabpage.TabNewWhen creating a new tabpage.TabNewEnteredAfter entering a new tabpage.TermChangedaccepted for compatibilityTermCloseWhen a terminal job ends.TermEnterAfter entering Terminal-mode.TermLeaveAfter leaving Terminal-mode.TermOpenWhen a terminal job is starting.TermRequestWhen a :terminal child process emits an OSC, DCS, or APC sequence.TermResponseWhen Nvim receives a DA1, OSC, DCS, or APC response from the host terminal.TextChangedAfter a change was made to the text in the current buffer in Normal mode.TextChangedIAfter a change was made to the text in the current buffer in Insert mode.TextChangedPAfter a change was made to the text in the current buffer in Insert mode, only when the popup menu is visible.TextChangedTAfter a change was made to the text in the current buffer in Terminal-mode.TextYankPostJust after a yank or deleting command, but not if the black hole register quote_ is used nor for setreg().UIEnterAfter a UI connects via nvim_ui_attach(), or after builtin TUI is started, after VimEnter.UILeaveAfter a UI disconnects from Nvim, or after builtin TUI is stopped, after VimLeave.UserNot executed automatically.VimEnterAfter doing all the startup stuff, including loading vimrc files, executing the "-c cmd" arguments, creating all windows and loading the buffers in them.VimLeaveBefore exiting Vim, just after writing the .shada file.VimLeavePreBefore exiting Vim, just before writing the shada file.VimResizedAfter the Vim window was resized, thus 'lines' and/or 'columns' changed.VimResumeAfter Nvim resumes from suspend state.VimSuspendBefore Nvim enters suspend state.WinClosedWhen closing a window, just before it is removed from the window layout.WinEnterAfter entering another window.WinLeaveBefore leaving a window.WinNewWhen a new window was created.WinNewPreBefore creating a new window.WinResizedAfter a window in the current tabpage changed width or height.WinScrolledAfter any window in the current tabpage scrolled the text (horizontally or vertically) or changed width or height.Starting Neovim
26Command-line arguments and environment
nvim file …edit files; the first is shown, the rest are the argument listnvim +{n} file · +/{pat} · +{cmd}open at line n · at the first match · run an ex command after loading-c {cmd} · --cmd {cmd}ex command after / before the config is read-ddiff mode: nvim -d a b-o[N] · -O[N] · -p[N]open files in horizontal splits · vertical splits · tab pages-Rread-only (view) mode-nno swap file; memory only-S {session}source a session file after loading — :mksession writes one-s {scriptin}read Normal-mode keystrokes from a file-u {config}use this file instead of init.lua; -u NONE skips config and plugins-i {shada}use this shada file; -i NONE reads and writes none--cleanfactory defaults: no user config, no plugins, no shada-l {script} [args]run a Lua script and exit; ends option processing-es · -Essilent batch (ex) mode, for scripted edits--headlessstart no UI--listen {addr}serve the RPC API on this socket or host:port--server {addr} --remote[-send|-expr|-ui|-tab|-silent]act on a running instance--embedspeak msgpack-RPC on stdin/stdout — how a GUI hosts Nvim--api-infodump the API metadata as msgpack--startuptime {file}write per-file startup timings-V[N][file]verbosity; -V1 -v adds the compiled-in paths to the version-v · -hversion · help--only file names after this$MYVIMRCthe config file that was actually read$NVIM_APPNAMEreplaces the nvim segment of every standard path — a whole separate profile$VIMRUNTIME · $NVIM · $NVIM_LOG_FILEthe runtime directory · the parent instance’s address inside :terminal · the log