📄 vi.html
字号:
<p>Matching shall be determined as follows, for an open parenthesis:</p><ol><li><p>Set a counter to 1.</p></li><li><p>Search forwards until a parenthesis is found or the end of the edit buffer is reached.</p></li><li><p>If the end of the edit buffer is reached, it shall be an error.</p></li><li><p>If an open parenthesis is found, increment the counter by 1.</p></li><li><p>If a close parenthesis is found, decrement the counter by 1.</p></li><li><p>If the counter is zero, the current character is the matching character.</p></li></ol><p>Matching for a close parenthesis shall be equivalent, except that the search shall be backwards, from the starting character tothe beginning of the buffer, a close parenthesis shall increment the counter by 1, and an open parenthesis shall decrement thecounter by 1.</p><p>Matching for brackets and curly braces shall be equivalent, except that searching shall be done for open and close brackets oropen and close curly braces. It is implementation-defined whether other characters are searched for and matched as well.</p><p>If used as a motion command:</p><ol><li><p>If the matching cursor was after the starting cursor in the edit buffer, and the starting cursor position was at or before thefirst non- <blank> non- <newline> in the starting line, and the matching cursor position was at or after the last non-<blank> non- <newline> in the matching line, the text region shall consist of the current line to the matching line,inclusive, and any text copied to a buffer shall be in line mode.</p></li><li><p>If the matching cursor was before the starting cursor in the edit buffer, and the starting cursor position was at or after thelast non- <blank> non- <newline> in the starting line, and the matching cursor position was at or before the first non-<blank> non- <newline> in the matching line, the text region shall consist of the current line to the matching line,inclusive, and any text copied to a buffer shall be in line mode.</p></li><li><p>Otherwise, the text region shall consist of the starting character to the matching character, inclusive, and any text copied toa buffer shall be in character mode.</p></li></ol><p>If not used as a motion command:</p><p><i>Current line</i>: Set to the line where the matching character is located.</p><p><i>Current column</i>: Set to the last column where any portion of the matching character is displayed.</p><h5><a name="tag_04_167_13_22"></a>Repeat Substitution</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><tt>&</tt></pre></dd></dl><p>Repeat the previous substitution command. This command shall be equivalent to the <a href="../utilities/ex.html"><i>ex</i></a><b>&</b> command with the current line as its addresses, and without <i>options</i>, <i>count</i>, or <i>flags</i>.</p><h5><a name="tag_04_167_13_23"></a>Return to Previous Context at Beginning of Line</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><tt>'</tt> <i>character</i></pre></dd></dl><p>It shall be an error if there is no line in the edit buffer marked by <i>character</i>.</p><p>If used as a motion command:</p><ol><li><p>If the starting cursor is after the marked cursor, then the locations of the starting cursor and the marked cursor in the editbuffer shall be logically swapped.</p></li><li><p>The text region shall consist of the starting line up to and including the marked line, and any text copied to a buffer shall bein line mode.</p></li></ol><p>If not used as a motion command:</p><p><i>Current line</i>: Set to the line referenced by the mark.</p><p><i>Current column</i>: Set to non- <blank>.</p><h5><a name="tag_04_167_13_24"></a>Return to Previous Context</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><tt>`</tt> <i>character</i></pre></dd></dl><p>It shall be an error if the marked line is no longer in the edit buffer. If the marked line no longer contains a character inthe saved numbered character position, it shall be as if the marked position is the first non- <blank>.</p><p>If used as a motion command:</p><ol><li><p>It shall be an error if the marked cursor references the same character in the edit buffer as the starting cursor.</p></li><li><p>If the starting cursor is after the marked cursor, then the locations of the starting cursor and the marked cursor in the editbuffer shall be logically swapped.</p></li><li><p>If the starting line is empty or the starting cursor is at or before the first non- <blank> non- <newline> of thestarting line, and the marked cursor line is empty or the marked cursor references the first character of the marked cursor line,the text region shall consist of all lines containing characters from the starting cursor to the line before the marked cursorline, inclusive, and any text copied to a buffer shall be in line mode.</p></li><li><p>Otherwise, if the marked cursor line is empty or the marked cursor references a character at or before the first non-<blank> non- <newline> of the marked cursor line, the region of text shall be from the starting cursor to the last non-<newline> of the line before the marked cursor line, inclusive, and any text copied to a buffer shall be in charactermode.</p></li><li><p>Otherwise, the region of text shall be from the starting cursor (inclusive), to the marked cursor (exclusive), and any textcopied to a buffer shall be in character mode.</p></li></ol><p>If not used as a motion command:</p><p><i>Current line</i>: Set to the line referenced by the mark.</p><p><i>Current column</i>: Set to the last column in which any portion of the character referenced by the mark is displayed.</p><h5><a name="tag_04_167_13_25"></a>Return to Previous Section</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><b>[</b><i>count</i><b>]</b> <tt>[[</tt></pre></dd></dl><p>Move the cursor backward through the edit buffer to the first character of the previous section boundary, <i>count</i>times.</p><p>If used as a motion command:</p><ol><li><p>If the starting cursor was at the first character of the starting line or the starting line was empty, and the first characterof the boundary was the first character of the boundary line, the text region shall consist of the current line up to and includingthe line where the <i>count</i>th next boundary starts, and any text copied to a buffer shall be in line mode.</p></li><li><p>If the boundary was the last line of the edit buffer or the last non- <newline> of the last line of the edit buffer, thetext region shall consist of the last character in the edit buffer up to and including the starting character, and any text savedto a buffer shall be in character mode.</p></li><li><p>Otherwise, the text region shall consist of the starting character up to but not including the first character in the<i>count</i>th next boundary, and any text copied to a buffer shall be in character mode.</p></li></ol><p>If not used as a motion command:</p><p><i>Current line</i>: Set to the line where the <i>count</i>th next boundary in the edit buffer starts.</p><p><i>Current column</i>: Set to the last column in which any portion of the first character of the <i>count</i>th next boundary isdisplayed, or column position 1 if the line is empty.</p><h5><a name="tag_04_167_13_26"></a>Move to Next Section</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><b>[</b><i>count</i><b>]</b> <tt>]]</tt></pre></dd></dl><p>Move the cursor forward through the edit buffer to the first character of the next section boundary, <i>count</i> times.</p><p>If used as a motion command:</p><ol><li><p>If the starting cursor was at the first character of the starting line or the starting line was empty, and the first characterof the boundary was the first character of the boundary line, the text region shall consist of the current line up to and includingthe line where the <i>count</i>th previous boundary starts, and any text copied to a buffer shall be in line mode.</p></li><li><p>If the boundary was the first line of the edit buffer, the text region shall consist of the first character in the edit bufferup to but not including the starting character, and any text copied to a buffer shall be in character mode.</p></li><li><p>Otherwise, the text region shall consist of the first character in the <i>count</i>th previous section boundary up to but notincluding the starting character, and any text copied to a buffer shall be in character mode.</p></li></ol><p>If not used as a motion command:</p><p><i>Current line</i>: Set to the line where the <i>count</i>th previous boundary in the edit buffer starts.</p><p><i>Current column</i>: Set to the last column in which any portion of the first character of the <i>count</i>th previousboundary is displayed, or column position 1 if the line is empty.</p><h5><a name="tag_04_167_13_27"></a>Move to First Non-<blank> Position on Current Line</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><tt>^</tt></pre></dd></dl>If used as a motion command: <ol><li><p>If the line has no non- <blank> non- <newline>s, or if the cursor is at the first non- <blank> non-<newline> of the line, it shall be an error.</p></li><li><p>If the cursor is before the first non- <blank> non- <newline> of the line, the text region shall be comprised of thecurrent character, up to, but not including, the first non- <blank> non- <newline> of the line.</p></li><li><p>If the cursor is after the first non- <blank> non- <newline> of the line, the text region shall be from thecharacter before the starting cursor up to and including the first non- <blank> non- <newline> of the line.</p></li><li><p>Any text copied to a buffer shall be in character mode.</p></li></ol><p>If not used as a motion command:</p><p><i>Current line</i>: Unchanged.</p><p><i>Current column</i>: Set to non- <blank>.</p><h5><a name="tag_04_167_13_28"></a>Current and Line Above</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><b>[</b><i>count</i><b>]</b> <tt>_</tt></pre></dd></dl><p>If there are less than <i>count</i> -1 lines after the current line in the edit buffer, it shall be an error.</p><p>If used as a motion command:</p><ol><li><p>If <i>count</i> is less than 2, the text region shall be the current line.</p></li><li><p>Otherwise, the text region shall include the starting line and the next <i>count</i> -1 lines.</p></li><li><p>Any text copied to a buffer shall be in line mode.</p></li></ol><p>If not used as a motion command:</p><p><i>Current line</i>: Set to current line + <i>count</i> -1.</p><p><i>Current column</i>: Set to non- <blank>.</p><h5><a name="tag_04_167_13_29"></a>Move Back to Beginning of Sentence</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><b>[</b><i>count</i><b>]</b> <tt>(</tt></pre></dd></dl><p>Move backward to the beginning of a sentence. This command shall be equivalent to the <b>[[</b> command, with the exception thatsentence boundaries shall be used instead of section boundaries.</p><h5><a name="tag_04_167_13_30"></a>Move Forward to Beginning of Sentence</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><b>[</b><i>count</i><b>]</b> <tt>)</tt></pre></dd></dl><p>Move forward to the beginning of a sentence. This command shall be equivalent to the <b>]]</b> command, with the exception thatsentence boundaries shall be used instead of section boundaries.</p><h5><a name="tag_04_167_13_31"></a>Move Back to Preceding Paragraph</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><b>[</b><i>count</i><b>]</b> <tt>{</tt></pre></dd>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -