📄 vi.html
字号:
</dl><p>Move back to the beginning of the preceding paragraph. This command shall be equivalent to the <b>[[</b> command, with theexception that paragraph boundaries shall be used instead of section boundaries.</p><h5><a name="tag_04_167_13_32"></a>Move Forward to Next Paragraph</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 the next paragraph. This command shall be equivalent to the <b>]]</b> command, with theexception that paragraph boundaries shall be used instead of section boundaries.</p><h5><a name="tag_04_167_13_33"></a>Move to Specific Column Position</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><b>[</b><i>count</i><b>]</b> <tt>|</tt></pre></dd></dl><p>For the purposes of this command, lines that are too long for the current display and that have been folded shall be treated ashaving a single, 1-based, number of columns.</p><p>If there are less than <i>count</i> columns in which characters from the current line are displayed on the screen, <i>count</i>shall be adjusted to be the last column in which any portion of the line is displayed on the screen.</p><p>If used as a motion command:</p><ol><li><p>If the line is empty, or the cursor character is the same as the character on the <i>count</i>th column of the line, it shall bean error.</p></li><li><p>If the cursor is before the <i>count</i>th column of the line, the text region shall be comprised of the current character, upto but not including the character on the <i>count</i>th column of the line.</p></li><li><p>If the cursor is after the <i>count</i>th column of the line, the text region shall be from the character before the startingcursor up to and including the character on the <i>count</i>th column 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 the last column in which any portion of the character that is displayed in the <i>count</i> columnof the line is displayed.</p><h5><a name="tag_04_167_13_34"></a>Reverse Find Character</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><b>[</b><i>count</i><b>]</b> <tt>,</tt></pre></dd></dl><p>If the last <b>F</b>, <b>f</b>, <b>T</b>, or <b>t</b> command was <b>F</b>, <b>f</b>, <b>T</b>, or <b>t</b>, this command shallbe equivalent to an <b>f</b>, <b>F</b>, <b>t</b>, or <b>T</b> command, respectively, with the specified <i>count</i> and the samesearch character.</p><p>If there was no previous <b>F</b>, <b>f</b>, <b>T</b>, or <b>t</b> command, it shall be an error.</p><h5><a name="tag_04_167_13_35"></a>Repeat</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><b>[</b><i>count</i><b>]</b> <tt>.</tt></pre></dd></dl><p>Repeat the last <b>!</b>, <b><</b>, <b>></b>, <b>A</b>, <b>C</b>, <b>D</b>, <b>I</b>, <b>J</b>, <b>O</b>, <b>P</b>,<b>R</b>, <b>S</b>, <b>X</b>, <b>Y</b>, <b>a</b>, <b>c</b>, <b>d</b>, <b>i</b>, <b>o</b>, <b>p</b>, <b>r</b>, <b>s</b>, <b>x</b>,<b>y</b>, or <b>˜</b> command. It shall be an error if none of these commands have been executed. Commands (other thancommands that enter text input mode) executed as a result of map expansions, shall not change the value of the last repeatablecommand.</p><p>Repeated commands with associated motion commands shall repeat the motion command as well; however, any specified <i>count</i>shall replace the <i>count</i>(s) that were originally specified to the repeated command or its associated motion command.</p><p>If the motion component of the repeated command is <b>f</b>, <b>F</b>, <b>t</b>, or <b>T</b>, the repeated command shall not setthe remembered search character for the <b>;</b> and <b>,</b> commands.</p><p>If the repeated command is <b>p</b> or <b>P</b>, and the buffer associated with that command was a numeric buffer named with anumber less than 9, the buffer associated with the repeated command shall be set to be the buffer named by the name of the previousbuffer logically incremented by 1.</p><p>If the repeated character is a text input command, the input text associated with that command is repeated literally:</p><ul><li><p>Input characters are neither macro or abbreviation-expanded.</p></li><li><p>Input characters are not interpreted in any special way with the exception that <newline>, <carriage-return>, and<control>-T behave as described in <a href="#tag_04_167_13_88">Input Mode Commands in vi</a> .</p></li></ul><p><i>Current line</i>: Set as described for the repeated command.</p><p><i>Current column</i>: Set as described for the repeated command.</p><h5><a name="tag_04_167_13_36"></a>Find Regular Expression</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><tt>/</tt></pre></dd></dl><p>If the input line contains no non- <newline>s, it shall be equivalent to a line containing only the last regularexpression encountered. The enhanced regular expressions supported by <i>vi</i> are described in <a href="ex.html#tag_04_45_13_58"><i>Regular Expressions in ex</i></a> .</p><p>Otherwise, the line shall be interpreted as one or more regular expressions, optionally followed by an address offset or a<i>vi</i> <b>z</b> command.</p><p>If the regular expression is not the last regular expression on the line, or if a line offset or <b>z</b> command is specified,the regular expression shall be terminated by an unescaped <tt>'/'</tt> character, which shall not be used as part of the regularexpression. If the regular expression is not the first regular expression on the line, it shall be preceded by zero or more<blank>s, a semicolon, zero or more <blank>s, and a leading <tt>'/'</tt> character, which shall not be interpreted aspart of the regular expression. It shall be an error to precede any regular expression with any characters other than these.</p><p>Each search shall begin from the character after the first character of the last match (or, if it is the first search, after thecursor). If the <b>wrapscan</b> edit option is set, the search shall continue to the character before the starting cursorcharacter; otherwise, to the end of the edit buffer. It shall be an error if any search fails to find a match, and an informationalmessage to this effect shall be displayed.</p><p>An optional address offset (see <a href="ex.html#tag_04_45_13_02"><i>Addressing in ex</i></a> ) can be specified after the lastregular expression by including a trailing <tt>'/'</tt> character after the regular expression and specifying the address offset.This offset will be from the line containing the match for the last regular expression specified. It shall be an error if the lineoffset would indicate a line address less than 1 or greater than the last line in the edit buffer. An address offset of zero shallbe supported. It shall be an error to follow the address offset with any other characters than <blank>s.</p><p>If not used as a motion command, an optional <b>z</b> command (see <a href="#tag_04_167_13_86">Redraw Window</a> ) can bespecified after the last regular expression by including a trailing <tt>'/'</tt> character after the regular expression, zero ormore <blank>s, a <tt>'z'</tt> , zero or more <blank>s, an optional new <b>window</b> edit option value, zero or more<blank>s, and a location character. The effect shall be as if the <b>z</b> command was executed after the <b>/</b> command.It shall be an error to follow the <b>z</b> command with any other characters than <blank>s.</p><p>The remembered search direction shall be set to forward.</p><p>If used as a motion command:</p><ol><li><p>It shall be an error if the last match references the same character in the edit buffer as the starting cursor.</p></li><li><p>If any address offset is specified, the last match shall be adjusted by the specified offset as described previously.</p></li><li><p>If the starting cursor is after the last match, then the locations of the starting cursor and the last match in the edit buffershall be logically swapped.</p></li><li><p>If any address offset is specified, the text region shall consist of all lines containing characters from the starting cursor tothe last match line, inclusive, and any text copied to a buffer shall be in line mode.</p></li><li><p>Otherwise, if the starting line is empty or the starting cursor is at or before the first non- <blank> non-<newline> of the starting line, and the last match line is empty or the last match starts at the first character of the lastmatch line, the text region shall consist of all lines containing characters from the starting cursor to the line before the lastmatch line, inclusive, and any text copied to a buffer shall be in line mode.</p></li><li><p>Otherwise, if the last match line is empty or the last match begins at a character at or before the first non- <blank>non- <newline> of the last match line, the region of text shall be from the current cursor to the last non- <newline>of the line before the last match line, inclusive, and any text copied to a buffer shall be in character mode.</p></li><li><p>Otherwise, the region of text shall be from the current cursor (inclusive), to the first character of the last match(exclusive), 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>: If a match is found, set to the last matched line plus the address offset, if any; otherwise,unchanged.</p><p><i>Current column</i>: Set to the last column on which any portion of the first character in the last matched string isdisplayed, if a match is found; otherwise, unchanged.</p><h5><a name="tag_04_167_13_37"></a>Move to First Character in Line</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><tt>0 </tt> (zero)</pre></dd></dl><p>Move to the first character on the current line. The character <tt>'0'</tt> shall not be interpreted as a command if it isimmediately preceded by a digit.</p><p>If used as a motion command:</p><ol><li><p>If the cursor character is the first character in the line, it shall be an error.</p></li><li><p>The text region shall be from the character before the cursor character up to and including the first character in 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>: The last column in which any portion of the first character in the line is displayed, or if the line isempty, unchanged.</p><h5><a name="tag_04_167_13_38"></a>Execute an ex Command</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><tt>:</tt></pre></dd></dl><p>Execute one or more <a href="../utilities/ex.html"><i>ex</i></a> commands.</p><p>If any portion of the screen other than the last line of the screen was overwritten by any <a href="../utilities/ex.html"><i>ex</i></a> command (except <b>shell</b>), <i>vi</i> shall display a message indicating that it is waitingfor an input from the user, and shall then read a character. This action may also be taken for other, unspecified reasons.</p><p>If the next character entered is a <tt>':'</tt> , another <a href="../utilities/ex.html"><i>ex</i></a> command shall be acceptedand executed. Any other character shall cause the screen to be refreshed and <i>vi</i> shall return to command mode.</p><p><i>Current line</i>: As specified for the <a href="../utilities/ex.html"><i>ex</i></a> command.</p><p><i>Current column</i>: As specified for the <a href="../utilities/ex.html"><i>ex</i></a> command.</p><h5><a name="tag_04_167_13_39"></a>Repeat Find</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><b>[</b><i>count</i><b>]</b> <tt>;</tt></pre></dd></dl><p>This command shall be equivalent to the last <b>F</b>, <b>f</b>, <b>T</b>, or <b>t</b> command, with the specified <i>count</i>,and with the same search character used for the last <b>F</b>, <b>f</b>, <b>T</b>, or <b>t</b> command. If there was no previous<b>F</b>, <b>f</b>, <b>T</b>, or <b>t</b> command, it shall be an error.</p><h5><a name="tag_04_167_13_40"></a>Shift Left</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><b>[</b><i>count</i><b>]</b> <tt><</tt> <i>motion</i></pre></dd></dl><p>If the motion command is the <b><</b> command repeated:</p><ol><li><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></li><li><p>The text region shall be from the current line, up to and including the next <i>count</i> -1 lines.</p></li></ol><p>Shift any line in the text region specified by the <i>count</i> and motion command one shiftwidth (see the <a href="../utilities/ex.html"><i>ex</i></a> <b>shiftwidth</b> option) toward the start of the line, as described by the <a href="../utilities/ex.html"><i>ex</i></a> <b><</b> command. The unshifted lines shall be copied to the unnamed buffer in linemode.</p><p><i>Current line</i>: If the motion was from the current cursor position toward the end of the edit buffer, unchanged. Otherwise,set to the first line in the edit buffer that is part of the text region specified by the motion command.</p><p><i>Current column</i>: Set to non- <blank>.</p><h5><a name="tag_04_167_13_41"></a>Shift Right</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><b>[</b><i>count</i><b>]</b> <tt>></tt> <i>motion</i></pre></dd></dl><p>If the motion command is the <b>></b> command repeated:</p><ol><li><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></li><li><p>The text region shall be from the current line, up to and including the next <i>count</i> -1 lines.</p></li></ol><p>Shift any line with characters in the text region specified by the <i>count</i> and motion command one shiftwidth (see the <ahref="../utilities/ex.html"><i>ex</i></a> <b>shiftwidth</b> option) away from the start of the line, as described by the <a href="../utilities/ex.html"><i>ex</i></a> <b>></b> command. The unshifted lines shall be copied into the unnamed buffer in linemode.</p><p><i>Current line</i>: If the motion was from the current c
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -