📄 vi.html
字号:
and the search continues (until the end of the editing buffer is found).If a right parenthesis is found when the count is less than orequal to zero, it is the matching parenthesis.For a right parenthesis (respectively curly brace)the editing buffer will be searchedbackward (to the beginning of the editing buffer), and each rightparenthesis increments the counter, and each left parenthesisdecrements it.When searching for parentheses, curly bracesare not counted, and vice versa.If there is nomatching character,the terminal will be alertedand the current position will remain unchanged.<p><i>Current line :</i>Move to the line containing the matching character, asdescribed above.<p><i>Current column :</i>Move to the column containing the matching character, asdescribed above.<h5><a name = "tag_001_014_2821_023"> </a>Repeat Substitution</h5><pre><code><i>Synopsis</i>: &</code></pre><p>Repeat the previous substitution command (equivalent to the<i><a href="ex.html">ex</a></i>& command)using the current line as the target.Flags specified on the previous substitution commandwill be ignored by this command.<p><i>Current line :</i>Unchanged.<p><i>Current column :</i>Unchanged if the previous current column indicatorvalue was<i>end-of-line</i>;otherwise, move to the first non-blank character of the current lineor the first character if the line is a blank line.<h5><a name = "tag_001_014_2821_024"> </a>Return to Previous Context at Beginning of Line</h5><xref type="5" name="virpcbl"></xref><pre><code><i>Synopsis</i>: "<br><i>Synopsis</i>: ' <i>letter</i></code></pre><p>Return to the previous context when followed by a'character, if the context still exists,placing the cursor at the first non-blank character of the lineor the last character if the line is a blank line.If the previous context no longer exists, the'command will have no effect.When followed by a lower-case letter from the POSIX locale,return to the linemarked with that letter (see themcommand),at the first non-blank character in the line.<p>When used with an operator such as <b>d</b> to specify an extentof text, the operation takes place over complete lines.(See also<xref href=virpc><a href="#tag_001_014_2821_025">Return to Previous Context</a></xref>.)<p><i>Current line :</i>Move to the line from the previous context.<p><i>Current column :</i>Move to the first non-blank character of the current lineor the last character if the line is a blank line.<h5><a name = "tag_001_014_2821_025"> </a>Return to Previous Context</h5><xref type="5" name="virpc"></xref><pre><code><i>Synopsis</i>: "<br><i>Synopsis</i>: ` <i>letter</i></code></pre><p>When followed by a ` character,return to the previous context,placing the cursor at the character position marked.(The previous context will be set whenevera non-relative move is made.)When followed by a lower-case letter from the POSIX locale,return to the linemarked with that letter (see the <b>m</b> command),at the character position marked.<p>When used with an operator such as <b>d</b> to specify an extentof text, the operation takes place from the exactmarked place to the current position within the line.(See also<xref href=virpcbl><a href="#tag_001_014_2821_024">Return to Previous Context at Beginning of Line</a></xref>.)<p><i>Current line :</i>Move to the line from the previous context.<p><i>Current column :</i>Set to the position of the character marked from the previous context.<h5><a name = "tag_001_014_2821_026"> </a>Return to Previous Section</h5><pre><code><i>Synopsis</i>: [[</code></pre><p>Back up to the previous section boundary.This command is affected by the<i><a href="ex.html">ex</a></i><b>sections</b>option.Note that the brackets in this commandare part of the command syntax itselfand are not metacharacters.<p>If the<i>lisp</i>option is set,a section boundary is also identified by aline with a leading"(".<p><i>Current line :</i>Move to the previous line that is a section boundaryor to the first line of theediting buffer if no more sectionboundaries exist preceding the current line.<p><i>Current column :</i>Move to the first non-blank character of the current lineor the last character if the line is a blank line.<h5><a name = "tag_001_014_2821_027"> </a>Move to Next Section</h5><pre><code><i>Synopsis</i>: ]]</code></pre><p>Move forward to a section boundary.This command is affected by the<i><a href="ex.html">ex</a></i><b>sections</b>option.Note that the brackets in this commandare part of the command syntax itselfand are not metacharacters.<p>If the<i>lisp</i>option is set,a section boundary is also identified by aline with a leading"(".<p><i>Current line :</i>Move to the next line that is a section boundaryor to the last line of theediting buffer if no more sectionboundaries exist following the current line.<p><i>Current column :</i>Move to the first non-blank character of the current lineor the last character if the line is a blank line.<h5><a name = "tag_001_014_2821_028"> </a>Move to First Non-blank Position on Current Line</h5><pre><code><i>Synopsis</i>: ^</code></pre><p>Move to the first non-blank position on the current line.<p><i>Current line :</i>Unchanged.<p><i>Current column :</i>Move to the first non-blank character of the current lineor the last character if the line is a blank line.<h5><a name = "tag_001_014_2821_029"> </a>Move Back to Beginning of Sentence</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> (</code></pre><p>Move backward to the beginning of a sentence.A<i>count</i>will move back that many sentences.<p>If the<i>lisp</i>option is set, a<i>lisp</i>s-expression is considered a sentencefor this command.<p><i>Current line :</i>Move to the line containing the beginning of the sentence.<p><i>Current column :</i>Move to the first non-blank character of the sentence.<h5><a name = "tag_001_014_2821_030"> </a>Move Forward to Beginning of Sentence</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> )</code></pre><p>Move forward to the beginning of a sentence.A<i>count</i>will move forward that many sentences.<p>If the<i>lisp</i>option is set, a<i>lisp</i>s-expression is considered a sentencefor this command.<p><i>Current line :</i>Move to the line containing the beginning of the sentence.<p><i>Current column :</i>Move to the first non-blank character of the sentence.<h5><a name = "tag_001_014_2821_031"> </a>Move Back to Preceding Paragraph</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b>{</code></pre><p>Move back to the beginning of the preceding paragraph.A<i>count</i>specifies the number of paragraphs to move backward.This command is affected by the<i><a href="ex.html">ex</a></i><b>paragraph</b>option.<p><i>Current line :</i>Move to the line containing the beginning of the previous paragraph.<p><i>Current column :</i>Move to the first non-blank character of the current line.<h5><a name = "tag_001_014_2821_032"> </a>Move Forward to Next Paragraph</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> }</code></pre><p>Move forward to the beginning of the next paragraph.A<i>count</i>specifies the number of paragraphs to move forward.This command is affected by the<i><a href="ex.html">ex</a></i><b>paragraph</b>option.<p><i>Current line :</i>Move to the line containing the beginning of the next paragraph.<p><i>Current column :</i>Move to the first non-blank character of the current line.<h5><a name = "tag_001_014_2821_033"> </a>Move to Specific Column Position</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> |</code></pre><p>Place the cursor in the column position identified by<i>count</i>(if that position exists on the line).If<i>count</i>is omitted, it defaults to 1.If the length of the current line is less than<i>count</i>,the cursor will be placed at the end of the current line.If the column position is spanned by atabor a wide character, the cursor will be placed on the characterfollowing the<i>count</i>-thcolumn position.<p><i>Current line :</i>Unchanged.<p><i>Current column :</i>Move to the column position represented by<i>count</i>.<h5><a name = "tag_001_014_2821_034"> </a>Reverse Find Character</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> ,</code></pre><p>Reverse the lastf,F,torTcommand,looking the other way in the current line.A<i>count</i>will be equivalent to repeating the search that many times.<p><i>Current line :</i>Unchanged.<p><i>Current column :</i>Move to the first column position of the next character found.<h5><a name = "tag_001_014_2821_035"> </a>Move to First Non-blank of Previous Line</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> -</code></pre><p>Move to the first non-blank character in the previous line.A<i>count</i>specifies how many lines to move back.<p><i>Current line :</i><i>line</i>-<i>count</i><p><i>Current column :</i>Move to the first non-blank character of the current lineor the last character if the line is a blank line.<h5><a name = "tag_001_014_2821_036"> </a>Repeat</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> .</code></pre><p>Repeat the last command that changed the buffer.A<i>count</i>will be passed on to the command being repeated.<p><i>Current line :</i>Dependent on the results of the execution of thelast command that changed the buffer.<p><i>Current column :</i>Dependent on the results of the execution of thelast command that changed the buffer.<h5><a name = "tag_001_014_2821_037"> </a>Find Regular Expression</h5><pre><code><i>Synopsis</i>: /</code></pre><p>Prompt the user to entera string on the last line on the screen,interpret it as a regular expression (see<xref href=exre><a href="ex.html#tag_001_014_598_050">Regular Expressions in ex</a></xref>),and scan forward for the next occurrence of a matching string.The search will begin when anewline characteror anescape characteris entered to terminate the pattern;it can be prematurely terminated with an interrupt.<p>When used with an operator to specify an extent of text,the defined region is from the current cursor positionto the beginning of the matched string.Whole lines can be specified by giving an offset from thematched line(using a closing / followed by a <b>+</b><i>n</i> or <b>-</b><i>n</i>).<p><i>Current line :</i>Move to the line in which the first (or next) regular expression match occurred.<p><i>Current column :</i>Move to the column of the first character of the matched string.<h5><a name = "tag_001_014_2821_038"> </a>Move to First Character in Line</h5><pre><code><i>Synopsis</i>: 0 (zero)</code></pre><p>Move to the first character on the current line.(The zero will not be interpreted as a commandwhen it is preceded by a non-zero digit.)<p><i>Current line :</i>Unchanged.<p><i>Current column :</i>Column position 1.<h5><a name = "tag_001_014_2821_039"> </a>Execute an ex Command</h5><xref type="5" name="viex"></xref><pre><code><i>Synopsis</i>: :</code></pre><p>Execute an<i><a href="ex.html">ex</a></i>command.The implementation need not support an<i><a href="ex.html">ex</a></i>command that enters input mode (that is,<b>append</b>,<b>change</b>or<b>insert</b>).The <b>:</b> character, as well as the entered command,will be displayed on the bottom line.The command will be executed when the input is terminated by entering anewline characteror anescape character.Typing a<control>-V(or<control>-Q)character will escape the following character,allowing its literal value to be entered.<dl><dt><b>Note:</b><dd>This special property of<control>-Vand<control>-Qis only effective in visual or open modesand in<i><a href="ex.html">ex</a></i>commands called from visual or open mode with the ":"command.</dl><p>If the<b>ex</b>command causes the screen to be scrolled or causes an escape to the shell,<b>vi</b>will display a message indicating that it is waiting for anewlinecharacter.When anewlineor anescapecharacter is entered, thescreen will be refreshed.<p>When executing an individual<i><a href="ex.html">ex</a></i>command by entering ":", it is not possible to enter anewline characteras part of the command because it is considered theend of the command.As explained in<xref href=exrep><a href="ex.html#tag_001_014_598_051">Replacement Strings in ex</a></xref>,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -