The use of buffers is THE way of copying text to another file see the `:e ' command. Otherwise you only copy to the undo buffer. With yank commands you can put `"' before the command, just as with delete commands. The sequences `\U' and `\L' turn such conversion on, either until `\E' or `\e' is encountered, or until the end of the replacement pattern. The sequences `\u' and `\l' cause the immediately following character in the replacement to be converted to upper- or lower-case respectively if this character is a letter. The sequence `\n' (with `n' in ) is replaced by the text matched by the n-th regular subexpression enclosed between `\(' and `\)'. Other meta-sequences possible in the replacement pattern are always introduced by the escaping character `\'. The meta-character `~' stands, in the replacement pattern, for the defining text of the previous replacement pattern. Each instance of `&' is replaced by the characters which the regular expression matched. The basic meta-characters for the replacement pattern are `&' and `~' these are given as `\&' and `\~' when nomagic is set. Instead of `/' any punctuation CHAR unequal to can be used as delimiter. change every non-overlapping occurrence of ) and `c' for `confirm' (type `y' to confirm a particular substitution, else ). Substitute (on lines x through y) the pattern (default the last pattern) with. Repeat latest `ex' substitute command, e.g. Repeat latest command times (`J' only once).
Switch lower and upper cases (should be an operator, like `c'). If the option `lisp' is set, this command will realign the lines described by as though they had been typed with the option `ai' set too. Overwrite the rest of the line, appending change - 1 times. Shift the lines described by one shiftwidth to the left. *ĭelete chars under and after the cursor. Buffers contain the latest 9 LINE deletions (`"1' is most recent). The undo buffer always contains the latest change. If is used as buffer name, the conjugate buffer will be augmented instead of overwritten with the text.
The deleted text will be in the buffer with the used letter. This is achieved by putting a `"' and a letter before the delete command. If the last command before a `.' command references a numbered buffer, the buffer number is incremented first (and the count is ignored):Įverything deleted can be stored into a buffer. A buffer containing lines is put only once, above the current line. Put the contents of the (default undo) buffer times before the cursor. A buffer containing lines is put only once, below the current line. Put the contents of the (default undo) buffer times after the cursor. Shift the lines described by one shiftwidth to the right. The count is only useful on a slow terminal. Undo all changes on a line, while not having moved off it (unfortunately). Search globally for and execute the `ex' on each occurrence. Pop the previous tag off the tagstack and return to its position. Use the name under the cursor in a `:ta' command. Search in the tags file where is defined (file, line), and go to it. To the first CHAR of the line on which the cursor was placed before the latest absolute jump.įind the next bracket and go to its match (also with `' and `'). To the cursor position before the latest absolute jump (of which are examples `/' and `G'). To the first CHAR of the line with the mark. To the previous section (default begin of file). To line from bottom of the screen (last). Number (`*' = allowed, `-' = not appropriate) You can edit/redistribute this document freely, as long as you don't make false claims on original authorship. Warning: some vi versions don't support the more esoteric features described in this document. Writing, editing other files, and quitting vi.This is not a tutorial, but a compact and usable listing of command and insert mode keys, ex commands and options. Being a (fairly) complete reference guide to the king of editors.