insert.txt ForVim version 9.1. Last change: 2025 Mar 09VIM REFERENCE MANUAL by Bram MoolenaarInsertInsert-modeInserting andreplacing textmode-ins-replMost of this fileis aboutInsert andReplace mode. At theend area fewcommands forinserting text in other ways.An overview of the most often used commands can be found in chapter 24 of theuser manualusr_24.txt.1.Special keysins-special-keys2.Special special keysins-special-special3.'textwidth' and'wrapmargin'optionsins-textwidth4.'expandtab','smarttab' and'softtabstop'optionsins-expandtab5.Replace modeReplace-mode6. VirtualReplace modeVirtual-Replace-mode7.Insert mode completionins-completion8.Insert mode commandsinserting9.Exinsert commandsinserting-ex10. Insertinga fileinserting-fileAlso see'virtualedit', for moving the cursor to positions where thereis nocharacter. Useful for editinga table.==============================================================================1.Special keysins-special-keysInInsert andReplace mode, the following characters havea special meaning;other characters are inserted directly. Toinsert one of these specialcharacters into the buffer, precedeit withCTRL-V. Toinserta<Nul>character use "CTRL-VCTRL-@" or "CTRL-V 000". On some systems, you have touse "CTRL-V 003" toinsertaCTRL-C.Note: WhenCTRL-Vis mapped you canoften useCTRL-Q insteadi_CTRL-Q.If you are working ina special language mode wheninserting text, see the'langmap' option,'langmap', on how to avoid switching this mode on and offall the time.If you have'insertmode' set,<Esc> anda few other keys get another meaning.See'insertmode'.charaction-----------------------------------------------------------------------i_CTRL-[i_<Esc><Esc> orCTRL-[Endinsert orReplace mode,go back toNormal mode. Finishabbreviation.Note: If your<Esc> keyis hard to hit on your keyboard, trainyourself to useCTRL-[.If Esc doesn't work and you are usinga Mac, tryCTRL-<Esc>.Or disable Listening under Accessibility preferences.i_CTRL-CCTRL-CQuitinsert mode,go back toNormal mode. Do not check forabbreviations. Does not trigger theInsertLeaveautocommandevent.i_CTRL-@CTRL-@Insert previously inserted text and stop insert.i_CTRL-ACTRL-AInsert previously inserted text.i_CTRL-Hi_<BS>i_BS<BS> orCTRL-HDelete the character before the cursor (seei_backspacingabout joining lines).See:fixdel if your<BS> key does notdo what you want.i_<Del>i_DEL<Del>Delete the character under the cursor. If the cursorisattheend of the line, and the'backspace' option includes"eol", delete the<EOL>; the next lineis appended after thecurrent one.See:fixdel if your<Del> key does notdo what you want.i_CTRL-WCTRL-WDelete theword before the cursor (seei_backspacing aboutjoining lines). See thesection "word motions",word-motions, for the definition ofa word.i_CTRL-UCTRL-UDelete all entered characters before the cursor in the currentline. If there are no newly entered characters and'backspace'is not empty, delete all characters before thecursor in the current line.IfC-indentingis enabled the indent will be adjusted if theline becomes blank.Seei_backspacing about joining lines.i_CTRL-Ii_<Tab>i_Tab<Tab> orCTRL-IInserta tab. If the'expandtab' optionis on, theequivalent number of spacesis inserted (useCTRL-V<Tab> toavoid the expansion; useCTRL-Q<Tab> ifCTRL-Vis mappedi_CTRL-Q). See also the'smarttab' option andins-expandtab.i_CTRL-Ji_<NL><NL> orCTRL-JBegin new line.i_CTRL-Mi_<CR><CR> orCTRL-MBegin new line.i_CTRL-KCTRL-K{char1}[char2]Enterdigraph (seedigraphs). When{char1}isa specialkey, the code for that keyis inserted in<> form. Forexample, thestring "<S-Space>" can be entered by typing<C-K><S-Space> (two keys). Neither charis considered formapping.CTRL-NFind next keyword (seei_CTRL-N).CTRL-PFind previous keyword (seei_CTRL-P).CTRL-R{register}i_CTRL-RInsert the contents ofa register. Between typingCTRL-R andthe second character,'"' will be displayed to indicate thatyou are expected to enter the name ofa register.The textis insertedas if you typed it, but mappings andabbreviations are not used. If you haveoptions like'textwidth','formatoptions', or'autoindent' set, this willinfluence what will be inserted. Thisis different from whathappens with the "p" command and pasting with the mouse.Special registers:'"'the unnamed register, containing the text ofthe last delete oryank'%'the current file name'#'the alternate file name'*'theclipboard contents (X11: primary selection)'+'theclipboard contents'/'the last searchpattern':'the last command-line'.'the last inserted texti_CTRL-R_-'-'the last small (less thana line) deleteregister. Thisis repeatable using. sinceit remembers theregister toput instead ofthe literal text to insert.i_CTRL-R_='='theexpression register: you are prompted toenter anexpression (seeexpression)Note that 0x80 (128 decimal)is used forspecial keys. E.g., you can use this to movethe cursor up:CTRL-R="\<Up>"UseCTRL-RCTRL-R toinsert text literally.When the resultisaList the items are usedas lines. They can have line breaks insidetoo.When the resultisaFloat it's automaticallyconverted toa String.Whenappend() orsetline()is invoked theundosequence will be broken.Seeregisters about registers.CTRL-RCTRL-R{register}i_CTRL-R_CTRL-RInsert the contents ofa register. Works like usinga singleCTRL-R, but the textis inserted literally, notas if typed.This differs when theregister contains characters like<BS>.Example, whereregistera contains "ab^Hc":CTRL-R aresults in "ac".CTRL-R CTRL-R aresults in "ab^Hc".Options'textwidth','formatoptions', etc. still apply. Ifyou also want to avoid these, useCTRL-RCTRL-O, see below.The '.'register (last inserted text)is still insertedastyped.After this command, the '.'register contains the text fromtheregisteras ifit was inserted by typing it.CTRL-RCTRL-O{register}i_CTRL-R_CTRL-OInsert the contents ofaregister literally and don'tauto-indent. Does the sameas pasting with the mouse<MiddleMouse>. When theregisterislinewise this willinsert the text above the current line, like withP.The '.'register (last inserted text)is still insertedastyped.After this command, the '.'register contains the commandtyped and not the text. I.e., the literals "^R^O" and not thetext from the register.Does not replace characters inReplace-mode!CTRL-RCTRL-P{register}i_CTRL-R_CTRL-PInsert the contents ofaregister literally and fix theindent, like[<MiddleMouse>.The '.'register (last inserted text)is still insertedastyped.After this command, the '.'register contains the commandtyped and not the text. I.e., the literals "^R^P" and not thetext from the register.Does not replace characters inReplace-mode!i_CTRL-TCTRL-TInsert one shiftwidth of indentat the start of the currentline. The indentis always rounded toa'shiftwidth' (thisisvi compatible).i_CTRL-DCTRL-DDelete one shiftwidth of indentat the start of the currentline. The indentis always rounded toa'shiftwidth' (thisisvi compatible).i_0_CTRL-D0CTRL-DDelete all indent in the current line.i_^_CTRL-D^CTRL-DDelete all indent in the current line. The indentisrestored in the next line. Thisis useful wheninsertingalabel.i_CTRL-VCTRL-VInsert next non-digit literally. For special keys, theterminal codeis inserted. It's also possible to enter thedecimal,octal or hexadecimal value ofa characteri_CTRL-V_digit.The characters typed right afterCTRL-V are not considered formapping.Note: WhenCTRL-Vis mapped (e.g., to paste text) you canoften useCTRL-Q insteadi_CTRL-Q.WhenmodifyOtherKeysis enabled then special Escape sequenceis converted back to whatit was withoutmodifyOtherKeys,unless the Shift keyis also pressed.i_CTRL-QCTRL-QSameasCTRL-V.Note: Someterminal connections may eatCTRL-Q,it doesn'twork then. It does work in the GUI.CTRL-SHIFT-Vi_CTRL-SHIFT-Vi_CTRL-SHIFT-QCTRL-SHIFT-QWorks just likeCTRL-V, unlessmodifyOtherKeysis active,thenit inserts the Escape sequence fora key with modifiers.Note: WhenCTRL-SHIFT-Vis intercepted by your system (e.g.,to paste text) you can often useCTRL-SHIFT-Q instead.However, in some terminals (e.g.GNOME Terminal),CTRL-SHIFT-Qquits theterminal without confirmation.CTRL-XEnterCTRL-X mode. Thisisa sub-mode where commands canbe given to complete words or scroll the window. Seei_CTRL-X andins-completion.i_CTRL-ECTRL-EInsert the character whichis below the cursor.i_CTRL-YCTRL-YInsert the character whichis above the cursor.Note that forCTRL-E andCTRL-Y'textwidth'is not used, to beable to copy characters froma long line.i_CTRL-_CTRL-_Switch between languages,as follows:- When ina rightleft window, revins and nohkmap are toggled, since English will likely be inserted in this case.- When ina norightleft window, revins and hkmap are toggled, since Hebrew will likely be inserted in this case.CTRL-_ moves the cursor to theend of the typed text.This commandis only available when the'allowrevins' optionis set.Please refer torileft.txt for more information aboutright-to-left mode.Only if compiled with the+rightleft feature.i_CTRL-^CTRL-^Toggle the use of typing language characters.When language:lmap mappings are defined:- If'iminsert'is 1 (langmap mappings used)it becomes0 (no langmap mappings used).- If'iminsert' has another valueit becomes 1, thus langmap mappings are enabled.When no language mappings are defined:- If'iminsert'is 2 (Input Method used)it becomes0 (no Input Method used).- If'iminsert' has another valueit becomes 2, thus the Input Methodis enabled.When set to 1, the value of the "b:keymap_name" variable, the'keymap' option or "<lang>" appears in the status line.The language mappings are normally used to type charactersthat are different from what the keyboard produces. The'keymap' option can be used toinstalla whole number of them.i_CTRL-]CTRL-]Trigger abbreviation, withoutinsertinga character.i_<Insert><Insert>Toggle betweenInsert andReplace mode.-----------------------------------------------------------------------i_backspacingThe effect of the<BS>,CTRL-W, andCTRL-U depend on the'backspace' option(unless'revins'is set). Thisisa comma-separatedlist of items:item actionindent allow backspacing over autoindenteol allow backspacing over end-of-line (join lines)start allow backspacing over the start position of insert;CTRL-W andCTRL-U stop onceat the start positionWhen'backspace'is empty,Vi compatible backspacingis used. You cannotbackspace over autoindent, before column 1 or before whereinsert started.For backwards compatibility the values "0", "1", "2" and "3" are also allowed,see'backspace'.If the'backspace' option does contain "eol" and the cursoris in column 1when one of the three keysis used, the current lineis joined with theprevious line. This effectively deletes the<EOL> in front of the cursor.i_CTRL-V_digitWithCTRL-V the decimal,octal or hexadecimal value ofa character can beentered directly. This way you can enter any character, excepta line break(<NL>, value 10). There are five ways to enter the character value:first charmode max nr of chars max value(none)decimal 3255o orOoctal 3377 (255)x orXhexadecimal 2ff (255)uhexadecimal 4ffff (65535)Uhexadecimal 87fffffff (2147483647)Normally you would type the maximum number of characters. Thus to enteraspace (value 32) you would type<C-V>032. You can omit the leading zero, inwhichcase the character typed after the numbermust bea non-digit. Thishappens for the other modesas well: As soonas you typea character thatisinvalid for the mode, the value beforeit will be used and the "invalid"characteris dealt with in the normal way.If you entera value of 10,it willend up in the fileasa 0. The 10isa<NL>, whichis used internally to represent the<Nul> character. Whenwritingthe buffer toa file, the<NL> characteris translated into<Nul>. The<NL>characteris writtenat theend of each line. Thus if you want toinserta<NL> character ina file you will have to makea line break.Also see'fileformat'.i_CTRL-Xinsert_expandCTRL-X entersa sub-mode where several commands can be used. Most of thesecommandsdo keyword completion; seeins-completion.Two commands can be used to scroll thewindow up or down, withoutexitinginsert mode:i_CTRL-X_CTRL-ECTRL-XCTRL-Escrollwindow one line up.When doing completion look here:complete_CTRL-Ei_CTRL-X_CTRL-YCTRL-XCTRL-Yscrollwindow one line down.When doing completion look here:complete_CTRL-YAfterCTRL-Xis pressed, eachCTRL-E (CTRL-Y) scrolls thewindow up (down) byone line unless that would cause the cursor to move from its current positionin the file. As soonas another keyis pressed,CTRL-X modeis exited andthat keyis interpretedas inInsert mode.==============================================================================2.Special special keysins-special-specialThe following keys are special. They stop the current insert,do something,and then restart insertion. This means you cando something without gettingout ofInsert mode. Thisis very handy if you prefer to use theInsert modeall the time, just like editors that don't havea separateNormal mode. Youmay also want to set the'backspace' option to "indent,eol,start" and set the'insertmode' option. You can useCTRL-O if you want to mapa function key toa command.The changes (inserted or deleted characters) before and after these keys canbe undone separately. Only the last change can be redone and always behaveslike an "i" command.charaction-----------------------------------------------------------------------<Up>cursor one line upi_<Up><Down>cursor one line downi_<Down>CTRL-G<Up>cursor one line up,insert start columni_CTRL-G_<Up>CTRL-Gkcursor one line up,insert start columni_CTRL-G_kCTRL-GCTRL-Kcursor one line up,insert start columni_CTRL-G_CTRL-KCTRL-G<Down>cursor one line down,insert start columni_CTRL-G_<Down>CTRL-Gjcursor one line down,insert start columni_CTRL-G_jCTRL-GCTRL-Jcursor one line down,insert start columni_CTRL-G_CTRL-J<Left>cursor one character lefti_<Left><Right>cursor one character righti_<Right><S-Left>cursor oneword back (like "b" command)i_<S-Left><C-Left>cursor oneword back (like "b" command)i_<C-Left><S-Right>cursor oneword forward (like "w" command)i_<S-Right><C-Right>cursor oneword forward (like "w" command)i_<C-Right><Home>cursor to first char in the linei_<Home><End>cursor to after last char in the linei_<End><C-Home>cursor to first char in the filei_<C-Home><C-End>cursor to after last char in the filei_<C-End><LeftMouse>cursor to position of mouse clicki_<LeftMouse><S-Up>movewindow one page upi_<S-Up><PageUp>movewindow one page upi_<PageUp><S-Down>movewindow one page downi_<S-Down><PageDown>movewindow one page downi_<PageDown><ScrollWheelDown> movewindow three lines downi_<ScrollWheelDown><S-ScrollWheelDown> movewindow one page downi_<S-ScrollWheelDown><ScrollWheelUp> movewindow three lines upi_<ScrollWheelUp><S-ScrollWheelUp> movewindow one page upi_<S-ScrollWheelUp><ScrollWheelLeft> movewindow six columns lefti_<ScrollWheelLeft><S-ScrollWheelLeft> movewindow one page lefti_<S-ScrollWheelLeft><ScrollWheelRight> movewindow six columns righti_<ScrollWheelRight><S-ScrollWheelRight> movewindow one page righti_<S-ScrollWheelRight>CTRL-Oexecute one command, return toInsert modei_CTRL-OCTRL-\CTRL-OlikeCTRL-O but don't move the cursori_CTRL-\_CTRL-OCTRL-Lwhen'insertmode'is set:go toNormal modei_CTRL-LCTRL-Gucloseundo sequence, start new changei_CTRL-G_uCTRL-GUdon't starta newundo block with the nexti_CTRL-G_Uleft/right cursor movement, if the cursorstays within the same line-----------------------------------------------------------------------Note: If the cursor keys take you out ofInsert mode, check the'noesckeys'option.TheCTRL-O command sometimes hasa side effect: If the cursor was beyond theend of the line,it will beput on the last character in the line. Inmappings it's often better to use<Esc> (firstput an "x" in the text,<Esc>will then alwaysput the cursor on it). Or useCTRL-\CTRL-O, but thenbeware of the cursor possibly being beyond theend of the line.Note that thecommand followingCTRL-\CTRL-O can still move the cursor,itis not restoredto its original position.TheCTRL-O command takes you toNormal mode. If you then usea command enterInsert mode againit normally doesn't nest. Thus when typing "a<C-O>a" andthen<Esc> takes you back toNormal mode, youdo not need to type<Esc> twice.An exceptionis when not typing the command, e.g. when executingamapping orsourcinga script. This makes mappings work that briefly switch toInsertmode.The shifted cursor keys are not available on all terminals.Another side effectis thatacount specified before the "i" or "a" commandisignored. Thatis becauserepeating the effect of the command afterCTRL-Oistoo complicated.An example for usingCTRL-G u::inoremap <C-H> <C-G>u<C-H>This redefines thebackspace key to starta newundo sequence. You can nowundo the effect of thebackspace key, withoutchanging what you typed beforethat, withCTRL-O u. Another example::inoremap <CR> <C-]><C-G>u<CR>This startsa newundo blockat each line break. It also expandsabbreviations before this.An example for usingCTRL-G U:inoremap <Left> <C-G>U<Left>inoremap <Right> <C-G>U<Right>inoremap <expr> <Home> col('.') == match(getline('.'), '\S') + 1 ? \ repeat('<C-G>U<Left>', col('.') - 1) : \ (col('.') < match(getline('.'), '\S') ? \ repeat('<C-G>U<Right>', match(getline('.'), '\S') + 0) : \ repeat('<C-G>U<Left>', col('.') - 1 - match(getline('.'), '\S')))inoremap <expr> <End> repeat('<C-G>U<Right>', col('$') - col('.'))inoremap ( ()<C-G>U<Left>This makesit possible to use the cursor keys inInsert mode, withoutstartinga newundo block and therefore using. (redo) will workas expected. Alsoenteringa text like (with the "("mapping from above): Lorem ipsum (dolorwill be repeatable by using. to the expected Lorem ipsum (dolor)UsingCTRL-O splits undo: the text typed before and afteritis undoneseparately. If you want to avoid this (e.g., ina mapping) you might be ableto useCTRL-R=i_CTRL-R. E.g., to calla function::imap <F2> <C-R>=MyFunc()<CR>When the'whichwrap' optionis set appropriately, the<Left> and<Right>keys on the first/last character in the line make the cursor wrap to theprevious/next line.TheCTRL-Gj andCTRL-Gk commands can be used toinsert text in front ofacolumn. Example: int i; int j;Position the cursor on the first "int", type "istatic<C-G>j ". Theresult is: static int i; int j;Wheninserting the same text in front of the column in every line, use theVisual blockwise command "I"v_b_I.==============================================================================3.'textwidth' and'wrapmargin'optionsins-textwidthThe'textwidth' option can be used to automatically breaka line beforeitgets too long. Set the'textwidth' option to the desired maximum linelength. If you then type more characters (not spaces or tabs), thelastword will beput ona new line (unlessitis the onlyword on theline). If you set'textwidth' to 0, this featureis disabled.The'wrapmargin' option does almost the same. The differenceis that'textwidth' hasa fixed width while'wrapmargin' depends on the width of thescreen. When using'wrapmargin' thisis equal to using'textwidth' withavalue equal to (columns-'wrapmargin'), where columnsis the width of thescreen.When'textwidth' and'wrapmargin' are both set,'textwidth'is used.If you don't really want to break the line, butview the line wrappedataconvenient place, see the'linebreak' option.The lineis only broken automatically when usingInsert mode, or whenappending toa line. When in replace mode and the line lengthis notchanged, the line will not be broken.Long lines are broken if you entera non-white character after the margin.The situations wherea line will be broken can be restricted by addingcharacters to the'formatoptions' option:"l" Only breaka line ifit was not longer than'textwidth' when theinsert started."v" Only breakata white character that has been entered during the currentinsert command. Thisis mostly Vi-compatible."lv" Only break if the line was not longer than'textwidth' when theinsert started and onlyata white character that has been entered during the currentinsert command. Only differs from "l" when entering non-white characters while crossing the'textwidth' boundary.Normally an internal function will be used to decide where to break the line.If you want todoit ina different way set the'formatexpr' option to anexpression that will take care of the line break.If you want to formata block of text, you can use the "gq" operator. Type"gq" andamovement command to move the cursor to theend of the block. Inmany cases, the command "gq}" willdo what you want (format until theend ofparagraph). Alternatively, you can use "gqap", which will format the wholeparagraph, no matter where the cursor currently is. Or you can useVisualmode: hit "v", move to theend of the block, and type "gq". See alsogq.==============================================================================4.'expandtab','smarttab' and'softtabstop'optionsins-expandtabIf the'expandtab' optionis on, spaces will be used to fill the amount ofwhitespace of the tab. If you want to entera real<Tab>, typeCTRL-V first(useCTRL-Q whenCTRL-Vis mappedi_CTRL-Q).The'expandtab' optionis off by default.Note that inReplace mode,a singlecharacteris replaced with several spaces. The result of thisis that thenumber of characters in the line increases. Backspacing will delete onespaceata time. The original character will beput back for only onespacethat youbackspace over (the last one).ins-smarttabWhen the'smarttab' optionis on,a<Tab> inserts'shiftwidth' positionsatthe beginning ofa line and'tabstop' positions in other places. This meansthat often spaces instead ofa<Tab> character are inserted. When'smarttab'is off,a<Tab> always inserts'tabstop' positions, and'shiftwidth'is onlyused for ">>" and the like.ins-softtabstopWhen the'softtabstop' optionis non-zero,a<Tab> inserts'softtabstop'positions, anda<BS> used to delete white space, will delete'softtabstop'positions. This feels like'tabstop' was set to'softtabstop', buta real<Tab> character still takes'tabstop' positions, so your file will still lookcorrect when used by other applications.If'softtabstop'is non-zero,a<BS> will try to deleteas much whitespace tomove to the previous'softtabstop' position, except when the previouslyinserted characterisa space, thenit will only delete the character beforethe cursor. Otherwise you cannot always deletea single character before thecursor. You will have to delete'softtabstop' characters first, and then typeextra spaces to get where you want to be.==============================================================================5.Replace modeReplaceReplace-modemode-replaceEnterReplace mode with the "R" command in normal mode.InReplace mode, one character in the lineis deleted for every character youtype. If thereis no character to delete (at theend of the line), thetyped characteris appended (as inInsert mode). Thus the number ofcharacters ina line stays the same until you get to theend of the line.Ifa<NL>is typed,a line breakis inserted and no characteris deleted.Be careful with<Tab> characters. If you typea normalprinting character inits place, the number of charactersis still the same, but the number ofcolumns will become smaller.If you delete characters inReplace mode (with<BS>,CTRL-W, orCTRL-U), whathappensis that you delete the changes. The characters that were replacedare restored. If you had typed past the existing text, the characters youadded are deleted. Thisis effectivelya character-at-a-time undo.If the'expandtab' optionis on,a<Tab> will replace one character withseveral spaces. The result of thisis that the number of characters in theline increases. Backspacing will delete onespaceata time. The originalcharacter will beput back for only onespace that youbackspace over (thelast one).==============================================================================6. VirtualReplace modevreplace-modeVirtual-Replace-modeEnter VirtualReplace mode with the "gR" command in normal mode.{not available when compiled without the |+vreplace| feature}VirtualReplace modeis similar toReplace mode, but instead ofreplacingactual characters in the file, you arereplacing screen real estate, so thatcharacters further on in the file never appear to move.So if you typea<Tab>it may replace several normal characters, and if youtypealetter on top ofa<Tab>it may not replace anythingat all, since the<Tab> will still line up to the same placeas before.Typinga<NL> still doesn't cause characters later in the file to appear tomove. The rest of the current line will be replaced by the<NL> (that is,they are deleted), andreplacing continues on the next line.A new lineisNOT inserted unless yougo past theend of the file.Interesting effects are seen when usingCTRL-T andCTRL-D. The charactersbefore the cursor are shifted sidewaysas normal, but characters later in theline still remain still.CTRL-T will hide some of the old line under theshifted characters, butCTRL-D will reveal them again.As withReplace mode, using<BS> etc will bring back the characters that werereplaced. This still works in conjunction with'smartindent',CTRL-T andCTRL-D,'expandtab','smarttab','softtabstop', etc.In'list' mode, VirtualReplace mode actsas ifit was not in'list' mode,unless "L"is in'cpoptions'.Note that the only situations for which characters beyond the cursor shouldappear to move are inList mode'list', and occasionally when'wrap'is set(and the line changes length to become shorter or wider than the width of thescreen). In other cases spaces may be inserted to avoid following charactersto move.This modeis very useful for editing<Tab> separated columns in tables, forentering new data while keeping all the columns aligned.==============================================================================7.Insert mode completionins-completionInInsert andReplace mode, there are several commands to complete part ofakeyword or line that has been typed. Thisis useful if you are usingcomplicated keywords (e.g., function names with capitals and underscores).Completion can be done for:1. Whole linesi_CTRL-X_CTRL-L2. keywords in the current filei_CTRL-X_CTRL-N3. keywords in'dictionary'i_CTRL-X_CTRL-K4. keywords in'thesaurus', thesaurus-stylei_CTRL-X_CTRL-T5. keywords in the current and included filesi_CTRL-X_CTRL-I6.tagsi_CTRL-X_CTRL-]7. file namesi_CTRL-X_CTRL-F8.definitions or macrosi_CTRL-X_CTRL-D9. Vim command-linei_CTRL-X_CTRL-V10.User defined completioni_CTRL-X_CTRL-U11. omni completioni_CTRL-X_CTRL-O12. Spelling suggestionsi_CTRL-X_s13. keywords in'complete'i_CTRL-Ni_CTRL-PAdditionally,i_CTRL-X_CTRL-Z stops completion withoutchanging the text.All these, exceptCTRL-N andCTRL-P, are done inCTRL-X mode. Thisisasub-mode ofInsert andReplace modes. You enterCTRL-X mode by typingCTRL-Xand one of theCTRL-X commands. You exitCTRL-X mode by typinga key thatisnota validCTRL-X mode command. Valid keys are theCTRL-X command itself,CTRL-N (next), andCTRL-P (previous).To get the current completion information,complete_info() can be used.Also see the'infercase' option if you want to adjust thecase of the match.Wheninsertinga selected candidateword from thepopup-menu, the part ofthe candidateword that does not match the queryis highlighted usinghl-ComplMatchIns. If fuzzyis enabled in'completeopt', highlighting willnot be applied.complete_CTRL-EWhen completionis active you can useCTRL-E to stopit andgo back to theoriginally typed text. TheCTRL-E will not be inserted.complete_CTRL-YWhen thepopup menuis displayed you can useCTRL-Y to stop completion andaccept the currently selected entry. TheCTRL-Yis not inserted. Typingaspace, Enter, or some other unprintable character will leave completion modeandinsert that typed character.When thepopup menuis displayed there area few more special keys, seepopupmenu-keys.Note: The keys that are valid inCTRL-X mode are not mapped. This allows for`:map<C-F><C-X><C-F>` to work (assuming "<"is not in'cpo'). The key thatendsCTRL-X mode (any key thatis nota validCTRL-X mode command)is mapped.Also, when doing completion with'complete' mappings applyas usual.E565Note: While completionis activeInsert mode can't be used recursively andbuffer text cannot be changed. Mappings that somehow invoke ":normal i.."will generate anE565 error.The following mappings are suggested to make typing the completion commandsa bit easier (although they will hide other commands; this requires "<"is notin'cpo'): :inoremap <C-]> <C-X><C-]> :inoremap <C-F> <C-X><C-F> :inoremap <C-D> <C-X><C-D> :inoremap <C-L> <C-X><C-L>Asa special case, typingCTRL-R to performregister insertion (seei_CTRL-R) will not exitCTRL-X mode. Thisis primarily to allow the use ofthe '='register to call some function to determine the next operation. Ifthe contents of theregister (or result of the '='register evaluation) arenot validCTRL-X mode keys, thenCTRL-X mode will be exitedas if those keyshad been typed.For example, the following will map<Tab> to either actuallyinserta<Tab> ifthe current lineis currently only whitespace, or start/continueaCTRL-Ncompletion operation:function! CleverTab() if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$' return "\<Tab>" else return "\<C-N>" endifendfunctioninoremap <Tab> <C-R>=CleverTab()<CR>Completing whole linescompl-whole-linei_CTRL-X_CTRL-LCTRL-XCTRL-LSearch backwards fora line that starts with thesame charactersas those in the current line beforethe cursor. Indentis ignored. The matching lineisinserted in front of the cursor.The'complete' optionis used to decide whichbuffersare searched fora match. Both loaded and unloadedbuffers are used.CTRL-LorCTRL-PSearch backwards for next matching line. This linereplaces the previous matching line.CTRL-NSearch forward for next matching line. This linereplaces the previous matching line.CTRL-XCTRL-LAfter expandinga line you can additionally get theline next toit by typingCTRL-XCTRL-L again, unlessa doubleCTRL-Xis used. Only works for loadedbuffers.Completing keywords in current filecompl-currenti_CTRL-X_CTRL-Pi_CTRL-X_CTRL-NCTRL-XCTRL-NSearch forwards for words that start with the keywordin front of the cursor. The found keywordis insertedin front of the cursor.CTRL-XCTRL-PSearch backwards for words that start with the keywordin front of the cursor. The found keywordis insertedin front of the cursor.CTRL-NSearch forward for next matching keyword. Thiskeyword replaces the previous matching keyword.CTRL-PSearch backwards for next matching keyword. Thiskeyword replaces the previous matching keyword.CTRL-XCTRL-N orCTRL-XCTRL-PFurther use ofCTRL-XCTRL-N orCTRL-XCTRL-P willcopy the words following the previous expansion inother contexts unlessa doubleCTRL-Xis used.If thereisa keyword in front of the cursor (a name made out of alphabeticcharacters and characters in'iskeyword'),itis usedas the search pattern,with "\<" prepended (meaning: start ofa word). Otherwise "\<\k\k"is usedas searchpattern (start of any keyword ofat least two characters).InReplace mode, the number of characters that are replaced depends on thelength of the matched string. This works like typing the characters of thematchedstring inReplace mode.If thereis nota valid keyword character before the cursor, any keyword ofat least two charactersis matched.e.g., to get: printf("(%g, %g, %g)", vector[0], vector[1], vector[2]);just type: printf("(%g, %g, %g)", vector[0], ^P[1], ^P[2]);The search wraps around theend of the file, the value of'wrapscan'is notused here.Multiple repeats of the same completion are skipped; thusa different matchwill be insertedat eachCTRL-N andCTRL-P (unless thereis only onematching keyword).Single character matches are never included,as they usually just get inthe way of what you were really after.e.g., to get:printf("name= %s\n", name);just type:printf("name= %s\n", n^P);or even:printf("name= %s\n", ^P);The 'n' in '\n'is skipped.After expandinga word, you can useCTRL-XCTRL-P orCTRL-XCTRL-N to get theword following the expansion in other contexts. These sequences search forthe text just expanded and further expand by getting an extra word. Thisisuseful if you need to repeata sequence of complicated words. AlthoughCTRL-PandCTRL-N look just for strings ofat least two characters,CTRL-XCTRL-P andCTRL-XCTRL-N can be used to expand words of just one character.e.g., to get:Méxicoyou can type:M^N^P^X^P^X^PCTRL-N starts the expansion and thenCTRL-P takes back the single character"M", the next twoCTRL-XCTRL-P's get the words "é" and ";xico".If the previous expansion was split, becauseit got longer than'textwidth',then just the text in the current line will be used.If the match foundisat theend ofa line, then the firstword in the nextline will be inserted and the message "Word from other line" displayed, ifthiswordis accepted the nextCTRL-XCTRL-P orCTRL-XCTRL-N will searchfor those linesstarting with this word.Completing keywords in'dictionary'compl-dictionaryi_CTRL-X_CTRL-KCTRL-XCTRL-KSearch the files given with the'dictionary' optionfor words that start with the keyword in front of thecursor. Thisis likeCTRL-N, but only the dictionaryfiles are searched, not the current file. The foundkeywordis inserted in front of the cursor. Thiscould potentially be pretty slow, since all matchesare found before the first matchis used. By default,the'dictionary' optionis empty.For suggestions where to findalist of words, see the'dictionary' option.'ignorecase','smartcase' and'infercase' apply.CTRL-KorCTRL-NSearch forward for next matching keyword. Thiskeyword replaces the previous matching keyword.CTRL-PSearch backwards for next matching keyword. Thiskeyword replaces the previous matching keyword.Completing words in'thesaurus'compl-thesaurusi_CTRL-X_CTRL-TCTRL-XCTRL-TWorksasCTRL-XCTRL-K, but ina special way. It usesthe'thesaurus' option instead of'dictionary'. Ifamatchis found in the thesaurus file, all theremaining words on the same line are includedasmatches, even though they don't complete the word.Thusaword can be completely replaced.CTRL-TorCTRL-NSearch forward for next matching keyword. Thiskeyword replaces the previous matching keyword.CTRL-PSearch backwards for next matching keyword. Thiskeyword replaces the previous matching keyword.In the file used by the'thesaurus' option each line in the file shouldcontain words with similar meaning, separated by non-keyword characters (whitespaceis preferred). Maximum line lengthis 510 bytes.For an example, imagine the'thesaurus' file hasa line like this:angry furious mad enragedPlacing the cursor after the letters "ang" and typingCTRL-XCTRL-T wouldcomplete theword "angry"; subsequent presses would change theword to"furious", "mad" etc.Other uses include translation between two languages, or grouping APIfunctions by keyword.An Englishwordlist was added to this github issue:https://github.com/vim/vim/issues/629#issuecomment-443293282Unpack thesaurus_pkg.zip,put the thesaurus.txt file somewhere, e.g.~/.vim/thesaurus/english.txt, and the'thesaurus' option to this file name.Completing keywords with'thesaurusfunc'compl-thesaurusfuncIf the'thesaurusfunc' optionis set, then the user specified functionisinvoked to get thelist of completion matches and the'thesaurus' optionisnot used. Seecomplete-functions for an explanation of how the functionisinvoked and whatit should return.Hereis an example that uses the "aiksaurus" command (provided by MagnusGroß): func Thesaur(findstart, base) if a:findstartreturn searchpos('\<', 'bnW', line('.'))[1] - 1 endif let res = [] let h = '' for l in systemlist('aiksaurus ' .. shellescape(a:base))if l[:3] == '=== ' let h = '(' .. substitute(l[4:], ' =*$', ')', '')elseif l ==# 'Alphabetically similar known words are: ' let h = "\U0001f52e"elseif l[0] =~ '\a' || (h ==# "\U0001f52e" && l[0] ==# "\t") call extend(res, map(split(substitute(l, '^\t', '', ''), ', '), {_, val -> {'word': val, 'menu': h}}))endif endfor return res endfunc if exists('+thesaurusfunc') set thesaurusfunc=Thesaur endifCompleting keywords in the current and included filescompl-keywordThe'include' optionis used to specifya line that contains an include filename. The'path' optionis used to search for include files.i_CTRL-X_CTRL-ICTRL-XCTRL-ISearch for the first keyword in the current andincluded files that starts with the same charactersas those before the cursor. The matched keywordisinserted in front of the cursor.CTRL-NSearch forwards for next matching keyword. Thiskeyword replaces the previous matching keyword.Note:CTRL-Iis the sameas<Tab>, whichis likely tobe typed aftera successful completion, thereforeCTRL-Iis not used for searching for the next match.CTRL-PSearch backward for previous matching keyword. Thiskeyword replaces the previous matching keyword.CTRL-XCTRL-IFurther use ofCTRL-XCTRL-I will copy the wordsfollowing the previous expansion in other contextsunlessa doubleCTRL-Xis used.Completingtagscompl-tagi_CTRL-X_CTRL-]CTRL-XCTRL-]Search for the firsttag that starts with the samecharactersas before the cursor. The matchingtagisinserted in front of the cursor. Alphabeticcharacters and characters in'iskeyword' are usedto decide which characters are included in thetagname (sameas fora keyword). See alsoCTRL-].The'showfulltag' option can be used to add contextfrom around thetag definition.CTRL-]orCTRL-NSearch forwards for next matching tag. Thistagreplaces the previous matching tag.CTRL-PSearch backward for previous matching tag. Thistagreplaces the previous matching tag.Completing file namescompl-filenamei_CTRL-X_CTRL-FCTRL-XCTRL-FSearch for the first file name that starts with thesame charactersas before the cursor. The matchingfile nameis inserted in front of the cursor.Alphabetic characters and characters in'isfname'are used to decide which characters are included inthe file name.Note: the'path' optionis not usedhere (yet).CTRL-ForCTRL-NSearch forwards for next matching file name. Thisfile name replaces the previous matching file name.CTRL-PSearch backward for previous matching file name.This file name replaces the previous matching filename.Completingdefinitions or macroscompl-defineThe'define' optionis used to specifya line that containsa definition.The'include' optionis used to specifya line that contains an include filename. The'path' optionis used to search for include files.i_CTRL-X_CTRL-DCTRL-XCTRL-DSearch in the current and included files for thefirst definition (or macro) name that starts withthe same charactersas before the cursor. The founddefinition nameis inserted in front of the cursor.CTRL-DorCTRL-NSearch forwards for next matchingmacro name. Thismacro name replaces the previous matchingmacroname.CTRL-PSearch backward for previous matchingmacro name.Thismacro name replaces the previous matchingmacroname.CTRL-XCTRL-DFurther use ofCTRL-XCTRL-D will copy the wordsfollowing the previous expansion in other contextsunlessa doubleCTRL-Xis used.Completing Vim commandscompl-vimCompletionis context-sensitive. It works like on the Command-line. Itcompletes anEx commandas wellas its arguments. Thisis useful whenwritinga Vim script.i_CTRL-X_CTRL-VCTRL-XCTRL-VGuess what kind of itemis in front of the cursor andfind the first match for it.Note: WhenCTRL-Vis mapped you can often useCTRL-Qinstead ofi_CTRL-Q.CTRL-VorCTRL-NSearch forwards for next match. This match replacesthe previous one.CTRL-PSearch backwards for previous match. This matchreplaces the previous one.CTRL-XCTRL-VFurther use ofCTRL-XCTRL-V willdo the sameasCTRL-V. This allowsmappinga key todo Vim commandcompletion, for example::imap <Tab> <C-X><C-V>User defined completioncompl-functionCompletionis done bya function that can be defined by the user with the'completefunc' option. See below for how the functionis called and anexamplecomplete-functions.i_CTRL-X_CTRL-UCTRL-XCTRL-UGuess what kind of itemis in front of the cursor andfind the first match for it.CTRL-UorCTRL-NUse the next match. This match replaces the previousone.CTRL-PUse the previous match. This match replaces theprevious one.Omni completioncompl-omniCompletionis done bya function that can be defined by the user with the'omnifunc' option. Thisis to be used for filetype-specific completion.See below for how the functionis called and an examplecomplete-functions.For remarks about specificfiletypes seecompl-omni-filetypes.More completion scripts will appear, check www.vim.org. Currently thereisafirst version for C++.i_CTRL-X_CTRL-OCTRL-XCTRL-OGuess what kind of itemis in front of the cursor andfind the first match for it.CTRL-OorCTRL-NUse the next match. This match replaces the previousone.CTRL-PUse the previous match. This match replaces theprevious one.Spelling suggestionscompl-spellingAword before orat the cursoris located and correctly spelled words aresuggested to replace it. If thereisa badly spelledword in the line, beforeor under the cursor, the cursoris moved to after it. Otherwise theword justbefore the cursoris used for suggestions, even thoughit isn't badly spelled.NOTE:CTRL-S suspends display in manyUnix terminals. Use 's' instead. TypeCTRL-Q to resume displaying.i_CTRL-X_CTRL-Si_CTRL-X_sCTRL-XCTRL-S orCTRL-XsLocate theword in front of the cursor and find thefirstspell suggestion for it.CTRL-SorCTRL-NUse the next suggestion. This replaces the previousone.Note that you can't use 's' here.CTRL-PUse the previous suggestion. This replaces theprevious one.Completing keywords from different sourcescompl-generici_CTRL-NCTRL-NFind next match for words that start with thekeyword in front of the cursor, looking in placesspecified with the'complete' option. The foundkeywordis inserted in front of the cursor.i_CTRL-PCTRL-PFind previous match for words that start with thekeyword in front of the cursor, looking in placesspecified with the'complete' option. The foundkeywordis inserted in front of the cursor.CTRL-NSearch forward for next matching keyword. Thiskeyword replaces the previous matching keyword.CTRL-PSearch backwards for next matching keyword. Thiskeyword replaces the previous matching keyword.CTRL-XCTRL-N orCTRL-XCTRL-PFurther use ofCTRL-XCTRL-N orCTRL-XCTRL-P willcopy the words following the previous expansion inother contexts unlessa doubleCTRL-Xis used.Stop completioncompl-stopi_CTRL-X_CTRL-ZCTRL-XCTRL-ZStop completion withoutchanging the text.FUNCTIONS FOR FINDING COMPLETIONScomplete-functionsThis applies to'completefunc','thesaurusfunc' and'omnifunc'.The functionis called in two different ways:- First the functionis called to find the start of the text to be completed.- Later the functionis called to actually find the matches.On the first invocation the arguments are: a:findstart 1 a:baseemptyThe functionmust return the column where the completion starts. Itmust beanumber between zero and the cursor column "col('.')". This involves lookingat the characters just before the cursor and including those characters thatcould be part of the completed item. The text between this column and thecursor column will be replaced with the matches. If the returned valueislarger than the cursor column, the cursor columnis used.Negative return values: -2To cancel silently and stay in completion mode. -3To cancel silently and leave completion mode. Another negative value: completion startsat the cursor columnOn the second invocation the arguments are: a:findstart0 a:basethe text with which matches should match; the text that waslocated in the first call (can be empty)The functionmust returnaList with the matching words. These matchesusually include the "a:base" text. When there are no matches return an emptyList.Note that the cursor may have moved since the first invocation, thetext may have been changed.In order to return more information than the matching words, returnaDictthat contains the List. TheDict can have these items:wordsTheList of matching words (mandatory).refreshAstring tocontrol re-invocation of the function(optional).The only value currently recognizedis "always", theeffectis that the functionis called whenever theleading textis changed.If you want to suppress the warning message for an empty result, returnv:none. Thisis useful to implement asynchronous completion withcomplete().Other items are ignored.For acting uponend of completion, see theCompleteDonePre andCompleteDoneautocommand event.For example, the function can contain this:let matches = ... list of words ...return {'words': matches, 'refresh': 'always'}complete-itemsEachlist item can either beastring ora Dictionary. Whenitisastringitis usedas the completion. WhenitisaDictionaryit can contain theseitems:wordthe text that will be inserted, mandatoryabbrabbreviation of "word"; when not emptyitis used inthe menu instead of "word"menuextra text for thepopup menu, displayed after "word"or "abbr"infomore information about the item, can be displayed inapreview orpopupwindowkindsingleletter indicating the type of completionicasewhen non-zerocaseis to be ignored when comparingitems to be equal; when omitted zerois used, thusitems that only differ incase are addedequalwhen non-zero, always treat this item to be equal whencomparing. Which means, "equal=1" disables filteringof this item.dupwhen non-zero this match will be added even when anitem with the samewordis already present.emptywhen non-zero this match will be added even whenitisan emptystringuser_datacustom data whichis associated with the item andavailable inv:completed_item;it can be any type;defaults to an emptystringabbr_hlgroupan additional highlight group whose attributes arecombined withhl-PmenuSel andhl-Pmenu orhl-PmenuMatchSel andhl-PmenuMatch highlightattributes in thepopup menu to apply cterm andguiproperties (with higher priority) likestrikethroughto the completion items abbreviationkind_hlgroupan additional highlight group specifically for settingthe highlight attributes of the completion kind. Whenthis fieldis present,it will override thehl-PmenuKind highlight group, allowing for thecustomization of ctermfg and guifg properties for thecompletion kindmatchSee "matches" incomplete_info().All of these except "icase", "equal", "dup" and "empty"must bea string. Ifan item does not meet these requirements then an error messageis given andfurther items in thelist are not used. You can mixstring andDictionaryitems in the returned list.The "menu" itemis used in thepopup menu and may be truncated, thusit shouldbe relatively short. The "info" item can be longer,it will be displayed inthe previewwindow when "preview" appears in'completeopt' or inapopupwindow when "popup" appears in'completeopt'. In the previewwindow the"info" item will also remain displayed after thepopup menu has been removed.Thisis useful for function arguments. Usea singlespace for "info" toremove existing text in the preview window. The size of the previewwindowisthree lines, but'previewheight'is used whenit hasa value of 1 or 2.complete-popupWhen "popup"is in'completeopt'apopupwindowis used to display the "info".Then the'completepopup' optionspecifies the properties of the popup. Thisis used when the infopopupis created. The optionisa comma-separatedlistof values:heightmaximum height of thepopupwidthmaximum width of thepopuphighlighthighlight group of thepopup (defaultis PmenuSel)align"item" (default) or "menu"border"on" (default) or "off"Example::set completepopup=height:10,width:60,highlight:InfoPopupWhen the "align" valueis "item" then thepopupis positioned close to theselected item. Changing the selection will also move the popup. When "align"is "menu" then thepopupis aligned with the top of the menu if the menuisbelow the text, and the bottom of the menu otherwise.After the infopopupis createdit can be found withpopup_findinfo() andproperties can be changed withpopup_setoptions().complete-popuphiddenIf the information for thepopupis obtained asynchronously, use "popuphidden"in'completeopt'. The infopopup will then be initially hidden andpopup_show()must be called onceit has been filled with the info. This canbe done withaCompleteChanged autocommand, something like this:set completeopt+=popuphiddenau CompleteChanged * call UpdateCompleteInfo()func UpdateCompleteInfo() " Cancel any pending info fetch let item = v:event.completed_item " Start fetching info for the item then call ShowCompleteInfo(info)endfuncfunc ShowCompleteInfo(info) let id = popup_findinfo() if id call popup_settext(id, 'async info: ' .. a:info) call popup_show(id) endifendfunccomplete-item-kindThe "kind" item usesa singleletter to indicate the kind of completion. Thismay be used to show the completion differently (different color or icon).Currently these types can be used:vvariableffunction ormethodmmember ofa struct orclassttypedefd#define ormacroWhen searching for matches takes some time callcomplete_add() to add eachmatch to the total list. These matches should then not appear in the returnedlist! Callcomplete_check() now and then to allow the user to pressa keywhile still searching for matches. Stop searching whenit returns non-zero.E840The functionis allowed to move the cursor,itis restored afterwards.The functionis not allowed to move to anotherwindow or delete text.An example that completes the names of the months:fun! CompleteMonths(findstart, base) if a:findstart " locate the start of the word let line = getline('.') let start = col('.') - 1 while start > 0 && line[start - 1] =~ '\a' let start -= 1 endwhile return start else " find months matching with "a:base" let res = [] for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec") if m =~ '^' .. a:basecall add(res, m) endif endfor return res endifendfunset completefunc=CompleteMonthsThe same, but now pretending searching for matchesis slow:fun! CompleteMonths(findstart, base) if a:findstart " locate the start of the word let line = getline('.') let start = col('.') - 1 while start > 0 && line[start - 1] =~ '\a' let start -= 1 endwhile return start else " find months matching with "a:base" for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec") if m =~ '^' .. a:basecall complete_add(m) endif sleep 300m" simulate searching for next match if complete_check()break endif endfor return [] endifendfunset completefunc=CompleteMonthsINSERT COMPLETION POPUP MENUins-completion-menupopupmenu-completionVim can display the matches ina simplisticpopup menu.The menuis used when:- The'completeopt' option contains "menu" or "menuone".- Theterminal supportsat least 8 colors.- There areat least two matches. One if "menuone"is used.The'pumheight' option can be used to seta maximum height. The defaultis touse allspace available.The'pumwidth' option can be used to seta minimum width. The defaultis 15characters.There are three states:1.A complete match has been inserted, e.g., after usingCTRL-N orCTRL-P.2.A cursor key has been used to select another match. The match was not inserted then, only the entry in thepopup menuis highlighted.3. Only part ofa match has been inserted and characters were typed or thebackspace key was used. Thelist of matches was then adjusted for whatis in front of the cursor.You normally start in the first state, with the first match being inserted.When "longest"is in'completeopt' and thereis more than one match you startin the third state.If you select another match, e.g., withCTRL-N orCTRL-P, yougo to the firststate. This doesn't change thelist of matches.When you are backat the original text then you are in the third state. Toget there right away you can useamapping that usesCTRL-P right afterstarting the completion::imap <F7> <C-N><C-P>popupmenu-keysIn the first state these keys havea special meaning:<BS> andCTRL-H Delete one character, find the matches for theword before the cursor. This reduces thelist of matches, often to one entry, and switches to the second state.Any non-special character: Stop completion withoutchanging the match andinsert the typed character.In the second and third state these keys havea special meaning:<BS> andCTRL-H Delete one character, find the matches for the shorterword before the cursor. This may find more matches.CTRL-L Add one character from the current match, may reduce the number of matches.any printable, non-white character: Add this character and reduce the number of matches.In all three states these can be used:CTRL-Y Yes: Accept the currently selected match and stop completion.CTRL-E End completion,go back to what was there before selectinga match (what was typed or longest common string).<PageUp>Selecta match several entries back, but don'tinsert it.<PageDown>Selecta match several entries further, but don'tinsert it.<Up>Select the previous match,as ifCTRL-P was used, but don'tinsert it.<Down>Select the next match,as ifCTRL-N was used, but don'tinsert it.<Space> or<Tab> Stop completion withoutchanging the match andinsert the typed character.The behavior of the<Enter> key depends on the state you are in:first state: Use the textasitis andinserta line break.second state:Insert the currently selected match.third state: Use the textasitis andinserta line break.In other words: If you used the cursor keys to select another entry in thelist of matches then the<Enter> key inserts that match. If you typedsomething else then<Enter> insertsa line break.The colors of the menu can be changed with these highlight groups:Pmenunormal itemhl-PmenuPmenuSelselected itemhl-PmenuSelPmenuSbarscrollbarhl-PmenuSbarPmenuThumbthumb of the scrollbarhl-PmenuThumbThere are no special mappings for when thepopup menuis visible. However,you can use anInsert modemapping that checks thepumvisible() function todo something different. Example::inoremap <Down> <C-R>=pumvisible() ? "\<lt>C-N>" : "\<lt>Down>"<CR>You can use of<expr> inmapping to have thepopup menu used when typingacharacter and some conditionis met. For example, for typinga dot:inoremap <expr> . MayComplete()func MayComplete() if (can complete) return ".\<C-X>\<C-O>" endif return '.'endfuncSee:map-<expr> for more info.FILETYPE-SPECIFIC REMARKS FOR OMNI COMPLETIONcompl-omni-filetypesThe file used for{filetype} should be autoload/{filetype}complete.vimin'runtimepath'. Thus for "java"itis autoload/javacomplete.vim.Cft-c-omniCompletion ofC code requiresatags file. You should use Universal/Exuberant ctags, becauseit adds extra information thatis needed forcompletion. You can findit here:Universal Ctags:https://ctags.ioExuberant Ctags:http://ctags.sourceforge.netUniversal Ctagsis preferred, Exuberant Ctagsis no longer being developed.For Exuberant ctags, version 5.6 or lateris recommended. For version 5.5.4you should adda patch that adds the "typename:" field:ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patchA compiled .exe forMS-Windows can be found at:http://ctags.sourceforge.net/https://github.com/universal-ctags/ctags-win32If you want to complete systemfunctions you cando something like this. Usectags to generateatags file for all the system header files:% ctags -R -f ~/.vim/systags /usr/include /usr/local/includeIn yourvimrc file add thistags file to the'tags' option:set tags+=~/.vim/systagsWhen usingCTRL-XCTRL-O aftera name without any "." or "->"itis completedfrom thetags file directly. This works for any identifier, also functionnames. If you want to completea local variable name, which does not appearin thetags file, useCTRL-P instead.When usingCTRL-XCTRL-O after something that has "." or "->" Vim will attemptto recognize the type of the variable and figure out what membersit has.This means only members valid for the variable will be listed.Whena member name already was complete,CTRL-XCTRL-O will adda "." or"->" for composite types.Vim doesn't includeaC compiler, only the most obviously formatteddeclarations are recognized. Preprocessor stuff may cause confusion.When the same structure name appears in multiple places all possible membersare included.CSSft-css-omniComplete properties and their appropriate values according to CSS 2.1specification.HTMLft-html-omniXHTMLft-xhtml-omniCTRL-XCTRL-O provides completion ofvarious elements of (X)HTML files. Itisdesigned to supportwriting of XHTML 1.0 Strict files but will also work forother versions of HTML. Features:- after "<" completetag name depending on context (no div suggestion inside of ana tag); '/>' indicates emptytags- inside oftag complete proper attributes (no width attribute for ana tag); show also type of attribute;'*' indicates required attributes- when attribute has limited number of possible valueshelp to complete them- complete names of entities- complete values of "class" and "id" attributes with data obtained from<style>tag and included CSS files- when completing value of "style" attribute or working inside of "style"tag switch toft-css-omni completion- when completing values of events attributes or working inside of "script"tag switch toft-javascript-omni completion- when used after "</"CTRL-XCTRL-O will close the last openedtagNote: When used first time completion menu will be shown with little delay- thisis time needed for loading of data file.Note: Completion may fail in badly formatted documents. In suchcase try torun:make command to detectformatting problems.HTML flavorhtml-flavorThe default HTML completion depends on the filetype. For HTML filesitisHTML 4.01 Transitional ('filetype'is "html"), for XHTMLitis XHTML 1.0Strict ('filetype'is "xhtml").When doing completion outside of any othertag you will have possibility tochoose DOCTYPE and the appropriate data file will be loaded and used for allnext completions.More about format of data file inxml-omni-datafile. Some of the data filesmay be found on the Vim website(www).Note that b:html_omni_flavor may point toa file with any XML data. Thismakes possible to mix PHP(ft-php-omni) completion with any XML dialect(assuming you have data file for it). Without setting that variable XHTML 1.0Strict will be used.JAVASCRIPTft-javascript-omniCompletion of most elements of JavaScript language and DOM elements.Complete:-variables- function name; show function arguments- function arguments- properties ofvariables trying to detect type of variable- complete DOMobjects and properties depending on context- keywords of languageCompletion works in separate JavaScript files (&ft==javascript), inside of<script>tag of (X)HTML and in values of event attributes (including scanningof external files).DOM compatibilityAt the moment (beginning of 2006) there are two main browsers- MS InternetExplorer and Mozilla Firefox. These two applications are covering over 90% ofmarket. Theoretically standards are created by W3C organisation(http://www.w3c.org) but they are not always followed/implemented.IEFFW3C Omni completion+/-+/-+ +++- ++-- --+- -Regardless from state of implementation in browsers but if elementis definedin standards, completionplugin will place element in suggestion list. Whenboth major engines implemented element, even if thisis not in standardsitwill be suggested. All other elements are not placed in suggestion list.PHPft-php-omniCompletion of PHP code requiresatags file for completion of data fromexternal files and forclass aware completion. You should use Universal/Exuberantctags version 5.5.4 or newer. You can findit here:Universal Ctags:https://ctags.ioExuberant Ctags:http://ctags.sourceforge.netScript completes:- after$variables name- if variable was declaredasobject add "->", iftags fileis available show name ofclass- after "->" complete only function and variable names specific for given class. To findclass location and contentstags fileis required. Because PHP isn't strongly typed language user can use @vartag to declare class:/* @var $myVar myClass */$myVar-> Still, to find myClass contentstags fileis required.- function names with additional info:- incase of built-infunctionslist of possible arguments and after | type data returned by function- incase of user function arguments and name of file where function was defined (ifitis not current file)- constants names-class names after "new" declarationNote: when doing completion first time Vim will load all necessary data intomemory. It may take several seconds. After next use of completion delayshould not be noticeable.Script detects if cursoris inside <?php ?> tags. Ifitis outsideit willautomatically switch to HTML/CSS/JavaScript completion.Note: contrary tooriginal HTML files completion oftags (and only tags) isn't context aware.RUBYft-ruby-omniCompletion ofRuby code requires that vim be built with+ruby.Ruby completion will parse your buffer on demand in order to providealist ofcompletions. These completions will be drawn from modules loaded by'require'and modules defined in the current buffer.The completions provided byCTRL-XCTRL-O are sensitive to the context: CONTEXT COMPLETIONS PROVIDED 1. Not insideaclass definition Classes, constants and globals 2. Insideaclass definition Methods or constants defined in theclass 3. After '.', '::' or ':' Methods applicable to theobject being dereferenced 4. After ':' or ':foo' Symbol name (beginning with'foo')Notes:- Vim will load/evaluate code in order to provide completions. This may cause some code execution, which may bea concern. Thisis no longer enabled by default, to enable this feature add let g:rubycomplete_buffer_loading = 1- In context 1 above, Vim can parse the entire buffer to addalist of classes to the completion results. This featureis turned off by default, to enableit add let g:rubycomplete_classes_in_global = 1 to yourvimrc- In context 2 above, anonymous classes are not supported.- In context 3 above, Vim will attempt to determine the methods supported by the object.- Vim can detect and load the Rails environment for files withina rails project. The featureis disabled by default, to enableit add let g:rubycomplete_rails = 1 to yourvimrcSYNTAXft-syntax-omniVim has the ability to colorsyntax highlight nearly 500 languages. Part ofthis highlighting includes knowing what keywords are part ofa language. Manyfiletypes already have custom completion scripts written for them, thesyntaxcompleteplugin provides basic completion for all other filetypes. Itdoes this by populating the omni completionlist with the text Vim alreadyknows how to color highlight. It can be used for anyfiletype and providesaminimal language-sensitive completion.To enablesyntax code completion you can run: setlocal omnifunc=syntaxcomplete#CompleteYou can automate this by placing the following in your.vimrc (after any":filetype" command): if has("autocmd") && exists("+omnifunc")autocmd Filetype * \if &omnifunc == "" | \setlocal omnifunc=syntaxcomplete#Complete | \endif endifThe above will set completion to thisscript only ifa specificplugin doesnot already exist for that filetype.Eachfiletype can havea wide range ofsyntax items. Theplugin allows you tocustomize whichsyntax groups to include or exclude from the list. Let's havea lookat the PHPfiletype to see how this works.If you edita file called, index.php, run the following command: syntax listThe first thing you will noticeis that there are many differentsyntax groups.The PHP language can include elements from different languages like HTML,JavaScript and many more. Thesyntaxplugin will only includesyntax groupsthat begin with the filetype, "php", in this case. For example thesesyntaxgroups are included by default with the PHP: phpEnvVar, phpIntVar,phpFunctions.If you wish non-filetypesyntax items to also be included, you can usearegularexpressionsyntax (added in version 13.0 ofautoload/syntaxcomplete.vim) to add items. Lookingat the output from":syntaxlist" while editinga PHP fileI can see some of these entries: htmlArg,htmlTag,htmlTagName,javaScriptStatement,javaScriptGlobalObjectsTo pick up any JavaScript and HTML keywordsyntax groups while editinga PHPfile, you can use 3 different regexs, one for each language. Or you cansimply restrict the include groups toa particular value, without usinga regex string: let g:omni_syntax_group_include_php = 'php\w\+,javaScript\w\+,html\w\+' let g:omni_syntax_group_include_php = 'phpFunctions,phpMethods'The basic form of this variable is: let g:omni_syntax_group_include_{filetype} = 'regex,comma,separated'The PHP language has an enormous number of items whichit knows how tosyntaxhighlight. These items will be available within the omni completion list.Some people may find thislist unwieldy or are only interested in certainitems. There are two ways to prune thislist (if necessary). If you findcertainsyntax groups youdo not wish displayed you can use two differentmethods to identify these groups. The first specifically lists thesyntaxgroups by name. The second usesa regularexpression to identify bothsyntax groups. Simply add one the following to your vimrc: let g:omni_syntax_group_exclude_php = 'phpCoreConstant,phpConstant' let g:omni_syntax_group_exclude_php = 'php\w*Constant'Addas manysyntax groups to thislist by comma separating them. The basicform of this variable is: let g:omni_syntax_group_exclude_{filetype} = 'regex,comma,separated'You can createas many of thesevariablesas you need, varying only thefiletypeat theend of the variable name.Theplugin uses the isKeyword option to determine whereword boundaries arefor thesyntax items. For example, in the Scheme language completion shouldinclude the "-", call-with-output-file. Depending on your filetype, this maynot provide the words you are expecting. Setting theg:omni_syntax_use_iskeyword option to0 will force thesyntaxplugin to breakonword characters. This can be controlled adding the following to yourvimrc: let g:omni_syntax_use_iskeyword = 0Forplugin developers, theplugin exposesa public function OmniSyntaxList.This function can be used to requestaList ofsyntax items. When editingaSQL file (:e syntax.sql) you can use the ":syntaxlist" command to see thevarious groups andsyntax items. For example: syntax listYields data similar to this: sqlOperator xxx some prior all like and any escape exists in is not or intersect minus between distinct links to Operator sqlType xxx varbit varchar nvarchar bigint int uniqueidentifier date money long tinyint unsigned xml text smalldate double datetime nchar smallint numeric time bit char varbinary binary smallmoney image float integer timestamp real decimalThere are twosyntax groups listed here: sqlOperator and sqlType. To retrieveaList ofsyntax items you can call OmniSyntaxLista number of differentways. To retrieve allsyntax items regardless ofsyntax group: echo OmniSyntaxList( [] )To retrieve only thesyntax items for the sqlOperatorsyntax group: echo OmniSyntaxList( ['sqlOperator'] )To retrieve allsyntax items for both the sqlOperator and sqlType groups: echo OmniSyntaxList( ['sqlOperator', 'sqlType'] )A regularexpression can also be used: echo OmniSyntaxList( ['sql\w\+'] )From withina plugin, you would typically assign the output toa List: let myKeywords = [] let myKeywords = OmniSyntaxList( ['sqlKeyword'] )SQLft-sql-omniCompletion for the SQL language includes statements, functions, keywords.It will also dynamically complete tables, procedures, views and column listswith data pulled directly from withina database. For detailed instructionsanda tutorial seeomni-sql-completion.The SQL completionplugin can be used in conjunction with other completionplugins. For example, the PHPfiletype has its own completion plugin.Since PHPis often used to generate dynamic website by accessinga database,the SQL completionplugin can also be enabled. This allows you to completePHP code and SQL codeat the same time.XMLft-xml-omniVim 7 providesa mechanism for context aware completion of XML files. Itdepends ona specialxml-omni-datafile and two commands::XMLns and:XMLent. Features are:- after "<" complete thetag name, depending on context- inside ofatag complete proper attributes- when an attribute hasa limited number of possible valueshelp to complete them- complete names of entities (defined inxml-omni-datafile and in the current file with "<!ENTITY" declarations)- when used after "</"CTRL-XCTRL-O will close the last openedtagFormat of XML data filexml-omni-datafileXML data files are stored in the "autoload/xml" directory in'runtimepath'.Vimdistribution provides examples of data files in the"$VIMRUNTIME/autoload/xml" directory. They havea meaningful name which willbe used in commands. It should bea unique name which will not createconflicts. For example, the name xhtml10s.vim meansitis the data file forXHTML 1.0 Strict.Each file containsa variable witha name like g:xmldata_xhtml10s. Itisa compound from two parts:1. "g:xmldata_" general prefix, constant for all data files2. "xhtml10s" the name of the file and the name of the described XML dialect;it will be usedas an argument for the:XMLns commandPart twomust be exactly the sameas name of file.The variableisaDictionary. Keys aretag names and each valueisa twoelementList. The first element of theListis alsoaList with the namesof possible children. The second elementisaDictionary with the names ofattributesas keys and the possible values of attributesas values. Example: let g:xmldata_crippled = { \ "vimxmlentities": ["amp", "lt", "gt", "apos", "quot"], \ 'vimxmlroot': ['tag1'], \ 'tag1': \ [ ['childoftag1a', 'childoftag1b'], {'attroftag1a': [], \ 'attroftag1b': ['valueofattr1', 'valueofattr2']}], \ 'childoftag1a': \ [ [], {'attrofchild': ['attrofchild']}], \ 'childoftag1b': \ [ ['childoftag1a'], {'attrofchild': []}], \ "vimxmltaginfo": { \ 'tag1': ['Menu info', 'Long information visible in preview window']}, \ 'vimxmlattrinfo': { \ 'attrofchild': ['Menu info', 'Long information visible in preview window']}}This example would beput in the "autoload/xml/crippled.vim" file and couldhelp to write this file: <tag1 attroftag1b="valueofattr1"> <childoftag1a attrofchild> & < </childoftag1a> <childoftag1b attrofchild="5"> <childoftag1a> > ' " </childoftag1a> </childoftag1b> </tag1>In the example four special elements are visible:1. "vimxmlentities"-a special key withList containing entities of this XML dialect.2. If thelist containing possible values of attributes has one element and this elementis equal to the name of the attribute this attribute will be treatedasboolean and insertedas'attrname' and notas 'attrname="'3. "vimxmltaginfo"-a special key withaDictionary containingtag namesas keys and two elementListas values, for additional menu info and the long description.4. "vimxmlattrinfo"- special key withDictionary containing attribute namesas keys and two elementListas values, for additional menu info and long description.Note: Tag names in the data file MUST not containa namespace description.Check xsl.vim for an example.Note: All data andfunctions are publicly availableas globalvariables/functions and can be used for personal editing functions.DTD-> Vimdtd2vimOnwwwis thescriptdtd2vim which parses DTD and creates an XML data filefor Vim XML omni completion. dtd2vim:http://www.vim.org/scripts/script.php?script_id=1462Check the beginning of that file for usage details.Thescript requiresperl and: perlSGML:http://savannah.nongnu.org/projects/perlsgmlCommands:XMLns{name} [{namespace}]:XMLnsVim has to know which data file should be used and with which namespace. Forloading of the data file and connecting data with the proper namespace use:XMLns command. The first (obligatory) argumentis the name of the data(xhtml10s, xsl). The second argumentis the code of namespace (h, xsl). Whenused withouta second argument the dialect will be usedas default- withoutnamespace declaration. For example to use XML completion in .xsl files::XMLns xhtml10s:XMLns xsl xsl:XMLent{name}:XMLentBy default entities will be completed from the data file of the defaultnamespace. The XMLent command should be used incase when thereis no defaultnamespace::XMLent xhtml10sUsageWhile used in this situation (after declarations from previous part, |iscursor position):<|Will complete to an appropriate XHTML tag, and in this situation:<xsl:|Will complete to an appropriate XSL tag.Thescript xmlcomplete.vim, provided through theautoload mechanism,has the xmlcomplete#GetLastOpenTag() function which can be used in XML filesto get the name of the last opentag (b:unaryTagsStack has to be defined)::echo xmlcomplete#GetLastOpenTag("b:unaryTagsStack")==============================================================================8.Insert mode commandsinsertingThe following commands can be used toinsert new text into the buffer. Theycan all be undone and repeated with the "." command.aaAppend text after the cursor[count] times. If thecursoris in the first column of an empty lineInsertstarts there. But not when'virtualedit'is set!AAAppend textat theend of the line[count] times.For using "A" inVisual block mode seev_b_A.<insert>oriinsert<Insert>iInsert text before the cursor[count] times.When usingCTRL-O inInsert modei_CTRL-O thecountis not supported.IIInsert text before the first non-blank in the line[count] times.When the 'H' flagis present in'cpoptions' and theline only contains blanks,insert start just beforethe last blank.For using "I" inVisual block mode seev_b_I.gIgIInsert text in column 1[count] times.gigiInsert text in the same positionas whereInsert modewas stopped last time in the current buffer.This uses the'^ mark. It's different from "`^i"when themarkis past theend of the line.The positionis corrected for inserted/deleted lines,but NOT for inserted/deleted characters.When the:keepjumps command modifieris used the'^mark won't be changed.ooBegina new line below the cursor andinsert text,repeat[count] times.When the '#' flagis in'cpoptions' thecountisignored.OOBegina new line above the cursor andinsert text,repeat[count] times.When the '#' flagis in'cpoptions' thecountisignored.These commands are used to startinserting text. You canendinsert mode with<Esc>. Seemode-ins-repl for the other special characters inInsert mode.The effect of[count] takes place afterInsert modeis exited.When'autoindent'is on, the indent fora new lineis obtained from theprevious line. When'smartindent' or'cindent'is on, the indent fora lineis automatically adjusted forC programs.'formatoptions' can be set to copy the comment leader when openinga newline.'textwidth' can be set to the maximum width fora line. Whena line becomestoo long when appending charactersa line breakis automatically inserted.==============================================================================9.Exinsert commandsinserting-ex:a:append:{range}a[ppend][!]Insert several lines of text below the specifiedline. If the{range}is missing, the text will beinserted after the current line.Adding [!] toggles'autoindent' for the time thiscommandis executed.This commandis not supported inVim9 script,becauseitis too easily confused witha variablename.:i:in:insert:{range}i[nsert][!]Insert several lines of text above the specifiedline. If the{range}is missing, the text will beinserted before the current line.Adding [!] toggles'autoindent' for the time thiscommandis executed.This commandis not supported inVim9 script,becauseitis too easily confused witha variablename.These two commands will keep on asking for lines, until you typea linecontaining onlya ".". Watch out for linesstarting witha backslash, seeline-continuation.Text typed aftera "|" command separatoris used first. So the followingcommand inex mode::a|onetwo.:visualappends the following text, after the cursor line:onetwoInEx-mode, when these commands are used with:global or:vglobal thenthe lines are obtained from the text following the command. Separate lineswitha NL escaped witha backslash::global/abc/insert\one line\another lineThe final "."is not needed then.NOTE: ":append" and ":insert" don't work properly in between ":if" and":endif", ":for" and ":endfor", ":while" and ":endwhile".:start:startinsert:star[tinsert][!]StartInsert mode just after executing this command.Works like typing "i" inNormal mode. When the!isincludedit works like "A", append to the line.Otherwise insertion startsat the cursor position.Note that when using this command ina function orscript, the insertion only starts after the functionorscriptis finished.This command does not work from:normal.:stopi:stopinsert:stopi[nsert]StopInsert modeas soonas possible. Works liketyping<Esc> inInsert mode.Can be used in an autocommand, example::au BufEnter scratch stopinsertreplacing-ex:startreplace:startr[eplace][!]StartReplace mode just after executing this command.Works just like typing "R" inNormal mode. When the!is includedit acts just like "$R" had been typed(ie. begin replace modeat the end-of-line). Other-wise replacement beginsat the cursor position.Note that when using this command ina function orscript that the replacement will only start afterthe function orscriptis finished.:startgreplace:startg[replace][!]Just like:startreplace, but use VirtualReplacemode, like withgR.==============================================================================10. Insertinga fileinserting-file:r:re:read:r[ead][++opt][name]Insert the file[name] (default: current file) belowthe cursor.See++opt for the possible values of[++opt].:{range}r[ead][++opt][name]Insert the file[name] (default: current file) belowthe specified line.See++opt for the possible values of[++opt].:r!:read!:[range]r[ead][++opt] !{cmd}Execute{cmd} andinsert its standard output belowthe cursor or the specified line.A temporary fileisused to store the output of the command whichis thenread into the buffer.'shellredir'is used to savethe output of the command, which can be set to includestderr or not.{cmd}is executed like with ":!{cmd}",any '!'is replaced with the previous command:!.See++opt for the possible values of[++opt].These commandsinsert the contents ofa file, or the output ofa command,into the buffer. They can be undone. They cannot be repeated with the "."command. They work ona line basis, insertion starts below the line in whichthe cursor is, or below the specified line. Toinsert text above the firstline use the command ":0r{name}".After the ":read" command, the cursoris left on the first non-blank in thefirst new line. If inEx mode, then the cursoris left on the last newline (sorry, thisisVi compatible).Ifa file nameis given with ":r",it becomes the alternate file. This can beused, for example, when you want to edit that file instead: ":e!#". This canbe switched off by removing the 'a' flag from the'cpoptions' option.Of the[++opt] arguments oneis specifically for ":read", the++edit argument.Thisis useful when the ":read" commandis actually used to reada file intothe bufferas if editing that file. Use this command in an empty buffer::read ++edit filenameThe effectis that the'fileformat','fileencoding','bomb', etc.options areset to what has been detected for "filename".Note thata single empty lineremains, you may want to delete it.file-readThe'fileformat' option sets the<EOL> style fora file:'fileformat' characters name "dos"<CR><NL> or<NL>DOS format "unix"<NL>Unix format "mac"<CR>Mac formatPreviously'textmode' was used. Itis obsolete now.If'fileformat'is "dos",a<CR> in front of an<NL>is ignored andaCTRL-Zat theend of the fileis ignored.If'fileformat'is "mac",a<NL> in the fileis internally represented bya<CR>. Thisis to avoid confusion witha<NL> whichis used to representa<NUL>. SeeCR-used-for-NL.If the'fileformats' optionis not empty Vim tries to recognize the type of<EOL> (seefile-formats). However, the'fileformat' option will not bechanged, the detected formatis only used while reading the file.A similar thing happens with'fileencodings'.On non-Win32 systems the message "[dos format]"is shown ifa fileis read inDOS format, to remind you that something unusualis done.OnMacintosh andWin32 the message "[unix format]"is shown ifa fileis readinUnix format.On non-Macintosh systems, the message "[mac format]"is shown ifa fileisread inMac format.An example on how to use ":r!"::r !uuencode binfile binfileThis command reads "binfile", uuencodesit and readsit into the currentbuffer. Useful when you are editing e-mail and want to includea binaryfile.read-messagesWhen readinga file Vim will displaya message with information about the readfile. In the tableis an explanation for some of the items. The others areself explanatory. Using the long or the short version depends on the'shortmess' option.longshortmeaning[readonly]{RO}the fileis write protected[fifo/socket]usinga stream[fifo]usinga fifo stream[socket]usinga socket stream[CR missing]reading with "dos"'fileformat' andaNL withouta preceding CR was found.[NL found]reading with "mac"'fileformat' andaNL was found (could be "unix" format)[long lines split]at least one line was split in two[NOT converted]conversion from'fileencoding' to'encoding' was desired but notpossible[converted]conversion from'fileencoding' to'encoding' done[crypted]file was decrypted[READ ERRORS]not all of the file could be read vim:tw=78:ts=8:noet:ft=help:norl: