📄 vi.html
字号:
a<control>-Mpreceded by a<control>-V(or<control>-Q)escape character in a regular expression substitution is mapped into anewline character.A different approach is to enter<i><a href="ex.html">ex</a></i>command mode by using the<i>vi</i>Qcommand (and later resuming visual mode with the<i><a href="ex.html">ex</a></i>vicommand).In<i><a href="ex.html">ex</a></i>command mode, the single-line limitation does not exist.So, for example, the following is valid:<pre><code>Qs/break here/break\here/vi</code></pre><p><i>Current line :</i>Dependent on the results of the execution of the<i><a href="ex.html">ex</a></i>command.<p><i>Current column :</i>Dependent on the results of the execution of the<i><a href="ex.html">ex</a></i>command.<h5><a name = "tag_001_014_2821_040"> </a>Repeat Find</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> ;</code></pre><p>Repeat the last character find usingf,F,torT.A<i>count</i>will move the cursor to (or next to) the<i>count</i>-thoccurrence of the character.<p><i>Current line :</i>Unchanged.<p><i>Current column :</i>Move to the column containing the character being searched for.If no matching character is found, it will be unchanged.<h5><a name = "tag_001_014_2821_041"> </a>Shift Left</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> < <i>motion</i></code></pre><p>Shift lines left one<i>shiftwidth</i>(see the<i><a href="ex.html">ex</a></i><b>shiftwidth</b>option).The command must be followed by a motion command to specify lines.A<i>count</i>will be passed through to the motion command.<p>When<i>motion</i>is"<",it will shift the current line(or<i>count</i>lines starting at the current one).<p><i>Current line :</i>Unchanged.<p><i>Current column :</i>Move to the first non-blank character of the lineor the last character if the line is a blank line.<h5><a name = "tag_001_014_2821_042"> </a>Shift Right</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> > <i>motion</i></code></pre><p>Shift lines right one<i>shiftwidth</i>(see the<i><a href="ex.html">ex</a></i><b>shiftwidth</b>option).The command must be followed by a motion command to specify lines.A<i>count</i>will be passed through to the motion command.<p>When<i>motion</i>is">",it will shift the current line(or<i>count</i>lines starting at the current one).<p>Empty lines will not be changed.<p><i>Current line :</i>Unchanged.<p><i>Current column :</i>Move to the first non-blank character of the lineor the last character if the line is a blank line.<h5><a name = "tag_001_014_2821_043"> </a>Scan Backwards for Regular Expression</h5><pre><code><i>Synopsis</i>: ?</code></pre><p>Scan backwards, the reverse of <b>/</b>.<p><i>Current line :</i>Move to the line in which the next succeeding 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_044"> </a>Execute</h5><pre><code><i>Synopsis</i>: @<i>buffer</i></code></pre><p>Execute each line of the named buffer as one or more<i>vi</i>commands (including<i><a href="ex.html">ex</a></i>commands, as described in<xref href=viex><a href="#tag_001_014_2821_039">Execute an ex Command</a></xref>).If the buffer name is @, then the last bufferexecuted is used;if there is no last buffer, an error will occur.The text of a macro may contain an @ character calling another macro;however, recursively calling the same macro produces undefined behaviour.A<i>vi</i>error will terminate all currently executing macros.All changes made during a macrocall will be treated as a unit and can be undone with a singleucommand.<p><i>Current line :</i>Dependent on the results of the execution of the<i>vi</i>commands.<p><i>Current column :</i>Dependent on the results of the execution of the<i>vi</i>commands.<h5><a name = "tag_001_014_2821_045"> </a>Reverse Case</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> ~</code></pre><p>Reverse the case of the<i>count</i>characters beginning at the current cursor position.Lower-case alphabetic characters will be changed to upper-case andupper-case characters changed to lower-case.This command will haveno effect on non-alphabetic characters.<p><i>Current line :</i>Unchanged.<p><i>Current column :</i>Move to the next column unless it is on the lastcharacter of the line, in which case it will remain unchanged.<h5><a name = "tag_001_014_2821_046"> </a>Reindent</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b>=<b>[</b><i>motion</i><b>]</b></code></pre><p>If the<i>lisp</i>option is set, reindents the specified lines,as though they were typed in with<b>lisp</b>and<b>autoindent</b>set.<p><i>Current line :</i>Unchanged.<p><i>Current column :</i>Move to the first non-blank character of the line or the last characterif the line is a blank line.<h5><a name = "tag_001_014_2821_047"> </a>Append</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> a</code></pre><p>Enter input mode, appending the entered text after the currentcursor position.A<i>count</i>will cause the inserted text up to the first newline characterto be replicated that many times; if a newline characterappears in the inserted text,only one occurrence of it and any characters following it will be inserted.For example, if the current line is<b>abc</b>,the command:<pre><code>03afoo<newline>bar</code></pre>changes that line to:<pre><code>afoofoofoobarbc</code></pre><p><i>Current line :</i>Unchanged.<p><i>Current column :</i><i>column</i>+ 1.<h5><a name = "tag_001_014_2821_048"> </a>Append at End-of-line</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> A</code></pre><p>Append<i>count</i>copies of the input text at the end of thecurrent line, equivalent to$<b>[</b><i>count</i><b>]</b>a.<p><i>Current line :</i>Unchanged.<p><i>Current column :</i>See theacommand.<h5><a name = "tag_001_014_2821_049"> </a>Move Backward to Preceding Word</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> b</code></pre><p>Move the cursor backward to the beginning of a word byrepeating the following algorithm<i>count</i>times:If the currentposition is at the beginning of a word,the currentposition will move to the first character of the preceding word.Otherwise, the current position will move to the firstcharacter of the word at the current position.If no preceding word exists on the current line, the currentposition will move to the first character of the last wordon the first preceding line that contains a word.For this command, an empty or blank line will be considered to containexactly one word.<p><i>Current line :</i>Set to the line containing the word selected.<p><i>Current column :</i>Set to the first character of the word selected.<h5><a name = "tag_001_014_2821_050"> </a>Move Backward to Preceding Bigword</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> B</code></pre><p>Move the cursor backward to the beginning of a bigword by repeating thefollowing algorithm<i>count</i>times:If the current position is at the beginning of a bigword or thecharacter at the current position cannot be part of a bigword, thecurrent position will move to the first character of the preceding bigword.Otherwise, the current position will move to the firstcharacter of the bigword at the current position.If no precedingbigword exists on the current line, the current position will move tothe first character of the last bigword on the first preceding linethat contains a bigword.For this command, an empty or blank line is consideredto contain exactly one bigword.<p><i>Current line :</i>Set to the line containing the bigword selected.<p><i>Current column :</i>Set to the first character of the bigword selected.<h5><a name = "tag_001_014_2821_051"> </a>Change</h5><pre><code><i>Synopsis</i>: <b>[</b><i>buffer</i><b>][</b><i>count</i><b>]</b> c <i>motion</i></code></pre><p>Delete the specified region of text and enter input mode toreplace it with the entered text.If more than part of a single line is affected,the deleted text will be saved in the numeric buffers.If only part of the current line is affected,then the last character to be deleted will bemarked with a $.A<i>count</i>will be passed through to themotion command.<p><i>Current line :</i>The current line and column position are dependent on the<i>motion</i>command following thec.For example,<b>cw</b>changes aword,c[[changes from the beginning of the current section, and so on.<p><i>Current column :</i>See<i>Current line ,</i>above<h5><a name = "tag_001_014_2821_052"> </a>Change to End-of-line</h5><pre><code><i>Synopsis</i>: <b>[</b><i>buffer</i><b>][</b><i>count</i><b>]</b> C</code></pre><p>Change text from the current position to the end-of-line(<i>line</i>+<i>count</i>- 1);equivalent to:<pre><code><b>[</b><i>buffer</i><b>][</b><i>count</i><b>]</b> c$</code></pre><p><i>Current line :</i>See theccommand.<p><i>Current column :</i>See theccommand.<h5><a name = "tag_001_014_2821_053"> </a>Delete</h5><pre><code><i>Synopsis</i>: <b>[</b><i>buffer</i><b>][</b><i>count</i><b>]</b> d <i>motion</i></code></pre><p>Delete the specified region of text.If more than part of a line is affected, thetext will be saved in the numeric buffersas well as any named<i>buffer</i>.A<i>count</i>will be passed through to themotion command.<p><i>Current line :</i>The current line and column position are dependent on the<i>motion</i>command following thed.For example,<b>dw</b>deletes aword,d$deletes to the end of the line, and so on.<p><i>Current column :</i>See<i>Current line ,</i>above.<h5><a name = "tag_001_014_2821_054"> </a>Delete to End-of-line</h5><pre><code><i>Synopsis</i>: <b>[</b><i>buffer</i><b>]</b> D</code></pre><p>Delete the text from the current position to the end ofthe current line; equivalent to:<pre><code><b>[</b><i>buffer</i><b>]</b> d$</code></pre><p><i>Current line :</i>Unchanged.<p><i>Current column :</i>Set to maximum of<i>column</i>- 1 or 1.<h5><a name = "tag_001_014_2821_055"> </a>Move to End-of-word</h5><pre><code><i>Synopsis</i>: <b>[</b><i>count</i><b>]</b> e</code></pre><p>Move the cursor forward to the end of a word, by repeating thefollowing algorithm<i>count</i>times:If the current position is theend of a word, the current position will move to the lastcharacter of the following word.Otherwise, the currentposition will move to the last character of the word at thecurrent position.If no succeeding word exists on the currentline, the current position will move to the last character ofthe first word on the next following line that contains a word.For this command,an empty or blank line is considered to containexactly one word.<p><i>Current line :</i>Set to the line containing the word selected.<p><i>Current column :</i>Set to the last character of the word selected.<h5><a name = "tag_001_0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -