📄 vi.chars
字号:
offset from the line matched by the pattern you can force whole linesto be affected. To do this give a pattern with a closinga closing \fB/\fR and then an offset \fB+\fR\fIn\fR or \fB\-\fR\fIn\fR..IPTo include the character \fB/\fR in the search string, you must escapeit with a preceding \fB\e\fR.A \fB\(ua\fR at the beginning of the pattern forces the match to occurat the beginning of a line only; this speeds the search. A \fB$\fR atthe end of the pattern forces the match to occur at the end of a lineonly.More extended pattern matching is available, see section 7.4;unless you set \fBnomagic\fR in your \fI\&.exrc\fR file you will haveto preceed the characters \fB. [ *\fR and \fB~\fR in the search patternwith a \fB\e\fR to get them to work as you would naively expect (1.5, 2,2,6.1, 7.2, 7.4)..iP "0" 15Moves to the first character on the current line.Also used, in forming numbers, after an initial \fB1\fR\-\fB9\fR..iP "1\-9" 15Used to form numeric arguments to commands (2.3, 7.2)..iP ":" 15A prefix to a set of commands for file and option manipulation and escapesto the system. Input is given on the bottom line and terminated withan \s-2CR\s0, and the command then executed. You can return to whereyou were by hitting \s-2DEL\s0 or \s-2RUB\s0 if you hit \fB:\fR accidentally(see primarily 6.2 and 7.3)..iP ";" 15Repeats the last single character find which used \fBf F t\fR or \fBT\fR.A count iterates the basic scan (4.1)..iP "<" 15An operator which shifts lines left one \fIshiftwidth\fR, normally 8spaces. Like all operators, affects lines when repeated, as in\fB<<\fR. Counts are passed through to the basic object, thus \fB3<<\fRshifts three lines (6.6, 7.2)..iP "=" 15Reindents line for \s-2LISP\s0, as though they were typed in with \fIlisp\fRand \fIautoindent\fR set (6.8)..iP ">" 15An operator which shifts lines right one \fIshiftwidth\fR, normally 8spaces. Affects lines when repeated as in \fB>>\fR. Counts repeat thebasic object (6.6, 7.2)..iP "?" 15Scans backwards, the opposite of \fB/\fR. See the \fB/\fR descriptionabove for details on scanning (2.2, 6.1, 7.4)..iP "@" 15A macro character (6.9). If this is your kill character, you must escape it with a \eto type it in during input mode, as it normally backs over the input youhave given on the current line (3.1, 3.4, 7.5)..iP "A" 15Appends at the end of line, a synonym for \fB$a\fR (7.2)..iP "B" 15Backs up a word, where words are composed of non-blank sequences, placingthe cursor at the beginning of the word. A count repeats the effect(2.4)..iP "C" 15Changes the rest of the text on the current line; a synonym for \fBc$\fR..iP "D" 15Deletes the rest of the text on the current line; a synonym for \fBd$\fR..iP "E" 15Moves forward to the end of a word, defined as blanks and non-blanks,like \fBB\fR and \fBW\fR. A count repeats the effect..iP "F" 15Finds a single following character, backwards in the current line.A count repeats this search that many times (4.1)..iP "G" 15Goes to the line number given as preceding argument, or the end of thefile if no preceding count is given. The screen is redrawn with thenew current line in the center if necessary (7.2)..iP "H" 15.B "Home arrow" .Homes the cursor to the top line on the screen. If a count is given,then the cursor is moved to the count'th line on the screen.In any case the cursor is moved to the first non-white character on theline. If used as the target of an operator, full lines are affected(2.3, 3.2)..iP "I" 15Inserts at the beginning of a line; a synonym for \fB\(uai\fR..iP "J" 15Joins together lines, supplying appropriate white space: one space betweenwords, two spaces after a \fB.\fR, and no spaces at all if the firstcharacter of the joined on line is \fB)\fR. A count causes that manylines to be joined rather than the default two (6.5, 7.1f)..iP "K" 15Unused..iP "L" 15Moves the cursor to the first non-white character of the last line onthe screen. With a count, to the first non-white of the count'th linefrom the bottom. Operators affect whole lines when used with \fBL\fR(2.3)..iP "M" 15Moves the cursor to the middle line on the screen, at the first non-whiteposition on the line (2.3)..iP "N" 15Scans for the next match of the last pattern given to\fB/\fR or \fB?\fR, but in the reverse direction; this is the reverseof \fBn\fR..iP "O" 15Opens a new line above the current line and inputs text there up to an\s-2ESC\s0. A count can be used on dumb terminals to specify a numberof lines to be opened; this is generally obsolete, as the \fIslowopen\fRoption works better (3.1)..iP "P" 15Puts the last deleted text back before/above the cursor. The text goesback as whole lines above the cursor if it was deleted as whole lines.Otherwise the text is inserted between the characters before and at thecursor. May be preceded by a named buffer specification \fB"\fR\fIx\fRto retrieve the contents of the buffer; buffers \fB1\fR\-\fB9\fR containdeleted material, buffers \fBa\fR\-\fBz\fR are available for generaluse (6.3)..iP "Q" 15Quits from \fIvi\fR to \fIex\fR command mode. In this mode, whole linesform commands, ending with a \s-2RETURN\s0. You can give all the \fB:\fRcommands; the editor supplies the \fB:\fR as a prompt (7.7)..iP "R" 15Replaces characters on the screen with characters you type (overlay fashion).Terminates with an \s-2ESC\s0..iP "S" 15Changes whole lines, a synonym for \fBcc\fR. A count substitutes forthat many lines. The lines are saved in the numeric buffers, and erasedon the screen before the substitution begins..iP "T" 15Takes a single following character, locates the character before thecursor in the current line, and places the cursor just after that character.A count repeats the effect. Most useful with operators such as \fBd\fR(4.1)..iP "U" 15Restores the current line to its state before you started changing it(3.5)..iP "V" 15Unused..iP "W" 15Moves forward to the beginning of a word in the current line,where words are defined as sequences of blank/non-blank characters.A count repeats the effect (2.4)..iP "X" 15Deletes the character before the cursor. A count repeats the effect,but only characters on the current line are deleted..iP "Y" 15Yanks a copy of the current line into the unnamed buffer, to be put backby a later \fBp\fR or \fBP\fR; a very useful synonym for \fByy\fR. A count yanks that many lines. May be preceded by a buffer name to putlines in that buffer (7.4)..iP "ZZ" 15Exits the editor.(Same as \fB:x\fP\s-2CR\s0.)If any changes have been made, the buffer is written out to the current file.Then the editor quits..iP "[[" 15Backs up to the previous section boundary. A section begins at eachmacro in the \fIsections\fR option,normally a `.NH' or `.SH' and also at lines which which startwith a formfeed \fB^L\fR. Lines beginning with \fB{\fR also stop \fB[[\fR;this makes it useful for looking backwards, a function at a time, in Cprograms. If the option \fIlisp\fR is set, stops at each \fB(\fR at thebeginning of a line, and is thus useful for moving backwards at the toplevel \s-2LISP\s0 objects. (4.2, 6.1, 6.6, 7.2)..iP "\e" 15Unused..iP "]]" 15Forward to a section boundary, see \fB[[\fR for a definition (4.2, 6.1,6.6, 7.2)..iP "\(ua" 15Moves to the first non-white position on the current line (4.4)..iP "_" 15Unused..iP "\(ga" 15When followed by a \fB\(ga\fR returns to the previous context.The previous context is set whenever the currentline is moved in a non-relative way.When followed by a letter \fBa\fR\-\fBz\fR, returns to the position whichwas marked with this letter with a \fBm\fR command.When used with an operator such as \fBd\fR, the operation takes placefrom the exact marked place to the current position within the line;if you use \fB\(aa\fR, the operation takes place over complete lines(2.2, 5.3)..iP "a" 15Appends arbitrary text after the current cursor position; the insertcan continue onto multiple lines by using \s-2RETURN\s0 within the insert.A count causes the inserted text to be replicated, but only if the insertedtext is all on one line.The insertion terminates with an \s-2ESC\s0 (3.1, 7.2)..iP "b" 15Backs up to the beginning of a word in the current line. A word is asequence of alphanumerics, or a sequence of special characters.A count repeats the effect (2.4)..iP "c" 15An operator which changes the following object, replacing it with thefollowing input text up to an \s-2ESC\s0. If more than part of a singleline is affected, the text which is changed away is saved in the numeric namedbuffers. If only part of the current line is affected, then the lastcharacter to be changed away is marked with a \fB$\fR.A count causes that many objects to be affected, thus both\fB3c)\fR and \fBc3)\fR change the following three sentences (7.4)..iP "d" 15An operator which deletes the following object. If more than part ofa line is affected, the text is saved in the numeric buffers.A count causes that many objects to be affected; thus \fB3dw\fR is thesame as \fBd3w\fR (3.3, 3.4, 4.1, 7.4)..iP "e" 15Advances to the end of the next word, defined as for \fBb\fR and \fBw\fR.A count repeats the effect (2.4, 3.1)..iP "f" 15Finds the first instance of the next character following the cursor onthe current line. A count repeats the find (4.1)..iP "g" 15Unused..spArrow keys.B h ,.B j ,.B k ,.B l ,and.B H ..iP "h" 15.B "Left arrow" .Moves the cursor one character to the left.Like the other arrow keys, either.B h ,the.B "left arrow"key, or one of the synonyms (\fB^H\fP) has the same effect.On v2 editors, arrow keys on certain kinds of terminals(those which send escape sequences, such as vt52, c100, or hp)cannot be used.A count repeats the effect (3.1, 7.5)..iP "i" 15Inserts text before the cursor, otherwise like \fBa\fR (7.2)..iP "j" 15.B "Down arrow" .Moves the cursor one line down in the same column.If the position does not exist,.I vicomes as close as possible to the same column.Synonyms include.B ^J(linefeed) and.B ^N ..iP "k" 15.B "Up arrow" .Moves the cursor one line up..B ^Pis a synonym..iP "l" 15.B "Right arrow" .Moves the cursor one character to the right.\s-2SPACE\s0 is a synonym..iP "m" 15Marks the current position of the cursor in the mark register which isspecified by the next character \fBa\fR\-\fBz\fR. Return to this positionor use with an operator using \fB\(ga\fR or \fB\(aa\fR (5.3)..iP "n" 15Repeats the last \fB/\fR or \fB?\fR scanning commands (2.2)..iP "o" 15Opens new lines below the current line; otherwise like \fBO\fR (3.1)..iP "p" 15Puts text after/below the cursor; otherwise like \fBP\fR (6.3)..iP "q" 15Unused..iP "r" 15Replaces the single character at the cursor with a single character youtype. The new character may be a \s-2RETURN\s0; this is the easiestway to split lines. A count replaces each of the following count characterswith the single character given; see \fBR\fR above which is the moreusually useful iteration of \fBr\fR (3.2)..iP "s" 15Changes the single character under the cursor to the text which followsup to an \s-2ESC\s0; given a count, that many characters from the currentline are changed. The last character to be changed is marked with \fB$\fRas in \fBc\fR (3.2)..iP "t" 15Advances the cursor upto the character before the next character typed.Most useful with operators such as \fBd\fR and \fBc\fR to delete thecharacters up to a following character. You can use \fB.\fR to deletemore if this doesn't delete enough the first time (4.1)..iP "u" 15Undoes the last change made to the current buffer. If repeated, willalternate between these two states, thus is its own inverse. When usedafter an insert which inserted text on more than one line, the lines aresaved in the numeric named buffers (3.5)..iP "v" 15Unused..iP "w" 15Advances to the beginning of the next word, as defined by \fBb\fR (2.4)..iP "x" 15Deletes the single character under the cursor. With a count deletesdeletes that many characters forward from the cursor position, but onlyon the current line (6.5)..iP "y" 15An operator, yanks the following object into the unnamed temporary buffer.If preceded by a named buffer specification, \fB"\fR\fIx\fR, the textis placed in that buffer also. Text can be recovered by a later \fBp\fRor \fBP\fR (7.4)..iP "z" 15Redraws the screen with the current line placed as specified by the followingcharacter: \s-2RETURN\s0 specifies the top of the screen, \fB.\fR thecenter of the screen, and \fB\-\fR at the bottom of the screen.A count may be given after the \fBz\fR and before the following characterto specify the new screen size for the redraw.A count before the \fBz\fR gives the number of the line to place in thecenter of the screen instead of the default current line. (5.4).iP "{" 15Retreats to the beginning of the beginning of the preceding paragraph.A paragraph begins at each macro in the \fIparagraphs\fR option, normally`.IP', `.LP', `.PP', `.QP' and `.bp'.A paragraph also begins after a completelyempty line, and at each section boundary (see \fB[[\fR above) (4.2, 6.8,7.6)..iP "|" 15Places the cursor on the character in the column specifiedby the count (7.1, 7.2)..iP "}" 15Advances to the beginning of the next paragraph. See \fB{\fR for thedefinition of paragraph (4.2, 6.8, 7.6)..iP "~" 15Unused..iP "^?\ (\s-2\fRDEL\fP\s0)" 15Interrupts the editor, returning it to command accepting state (1.5,7.5).bp\&.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -