1 Star 0 Fork 0

hilarryxu/vimdoc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
usr_20.html 36.16 KB
一键复制 编辑 原始数据 按行查看 历史
hilarryxu 提交于 2017-08-15 10:58 . Init repo
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>usr_20 - Vim Documentation</title>
<meta name="Generator" content="Vim/8.0">
<meta name="plugin-version" content="vim8.0">
<meta name="syntax" content="help">
<meta name="settings" content="no_pre,use_css,expand_tabs">
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="jquery.min.js" type="text/javascript"></script>
<script src="mark-current-page.js" type="text/javascript"></script>
</head>
<body>
<header>
<div class="header">
<a href="http://vim-jp.org/">vim-jp</a>
/ <a href="http://vim-jp.org/vimdoc-en/">vimdoc-en</a>
/ usr_20<br />
<a name="top"></a><h1>usr_20 - Vim Documentation</h1>
<a href="index.html">Return to main</a>
<span class="EnglishJapaneseLink">
<span class="CurrentLanguage">English</span>
</span>
</div>
</header>
<nav>
<dl>
<dt>BASIC</dt>
<dd><ul>
<li><a href="quickref.html">quickref</a></li>
<li><a href="sponsor.html">sponsor</a></li>
</ul></dd>
<dt>USER MANUAL</dt>
<dd><ul>
<li><a href="usr_toc.html">usr_toc</a></li>
</ul></dd>
<dt>Getting Started</dt>
<dd><ul>
<li><a href="usr_01.html">usr_01</a></li>
<li><a href="usr_02.html">usr_02</a></li>
<li><a href="usr_03.html">usr_03</a></li>
<li><a href="usr_04.html">usr_04</a></li>
<li><a href="usr_05.html">usr_05</a></li>
<li><a href="usr_06.html">usr_06</a></li>
<li><a href="usr_07.html">usr_07</a></li>
<li><a href="usr_08.html">usr_08</a></li>
<li><a href="usr_09.html">usr_09</a></li>
<li><a href="usr_10.html">usr_10</a></li>
<li><a href="usr_11.html">usr_11</a></li>
<li><a href="usr_12.html">usr_12</a></li>
</ul></dd>
<dt>Editing Effectively</dt>
<dd><ul>
<li><a href="usr_20.html">usr_20</a></li>
<li><a href="usr_21.html">usr_21</a></li>
<li><a href="usr_22.html">usr_22</a></li>
<li><a href="usr_23.html">usr_23</a></li>
<li><a href="usr_24.html">usr_24</a></li>
<li><a href="usr_25.html">usr_25</a></li>
<li><a href="usr_26.html">usr_26</a></li>
<li><a href="usr_27.html">usr_27</a></li>
<li><a href="usr_28.html">usr_28</a></li>
<li><a href="usr_29.html">usr_29</a></li>
<li><a href="usr_30.html">usr_30</a></li>
<li><a href="usr_31.html">usr_31</a></li>
<li><a href="usr_32.html">usr_32</a></li>
</ul></dd>
<dt>Tuning Vim</dt>
<dd><ul>
<li><a href="usr_40.html">usr_40</a></li>
<li><a href="usr_41.html">usr_41</a></li>
<li><a href="usr_42.html">usr_42</a></li>
<li><a href="usr_43.html">usr_43</a></li>
<li><a href="usr_44.html">usr_44</a></li>
<li><a href="usr_45.html">usr_45</a></li>
</ul></dd>
<dt>Making Vim Run</dt>
<dd><ul>
<li><a href="usr_90.html">usr_90</a></li>
</ul></dd>
<dt>General subjects</dt>
<dd><ul>
<li><a href="intro.html">intro</a></li>
<li><a href="index.html">help</a></li>
<li><a href="helphelp.html">helphelp</a></li>
<li><a href="vimindex.html">index</a></li>
<li><a href="tags.html">tags</a></li>
<li><a href="howto.html">howto</a></li>
<li><a href="tips.html">tips</a></li>
<li><a href="message.html">message</a></li>
<li><a href="quotes.html">quotes</a></li>
<li><a href="todo.html">todo</a></li>
<li><a href="debug.html">debug</a></li>
<li><a href="develop.html">develop</a></li>
<li><a href="uganda.html">uganda</a></li>
</ul></dd>
<dt>Basic editing</dt>
<dd><ul>
<li><a href="starting.html">starting</a></li>
<li><a href="editing.html">editing</a></li>
<li><a href="motion.html">motion</a></li>
<li><a href="scroll.html">scroll</a></li>
<li><a href="insert.html">insert</a></li>
<li><a href="change.html">change</a></li>
<li><a href="indent.html">indent</a></li>
<li><a href="undo.html">undo</a></li>
<li><a href="repeat.html">repeat</a></li>
<li><a href="visual.html">visual</a></li>
<li><a href="various.html">various</a></li>
<li><a href="recover.html">recover</a></li>
</ul></dd>
<dt>Advanced editing</dt>
<dd><ul>
<li><a href="cmdline.html">cmdline</a></li>
<li><a href="options.html">options</a></li>
<li><a href="pattern.html">pattern</a></li>
<li><a href="map.html">map</a></li>
<li><a href="tagsrch.html">tagsrch</a></li>
<li><a href="quickfix.html">quickfix</a></li>
<li><a href="windows.html">windows</a></li>
<li><a href="tabpage.html">tabpage</a></li>
<li><a href="syntax.html">syntax</a></li>
<li><a href="spell.html">spell</a></li>
<li><a href="diff.html">diff</a></li>
<li><a href="autocmd.html">autocmd</a></li>
<li><a href="filetype.html">filetype</a></li>
<li><a href="eval.html">eval</a></li>
<li><a href="channel.html">channel</a></li>
<li><a href="fold.html">fold</a></li>
</ul></dd>
<dt>Special issues</dt>
<dd><ul>
<li><a href="print.html">print</a></li>
<li><a href="remote.html">remote</a></li>
<li><a href="term.html">term</a></li>
<li><a href="digraph.html">digraph</a></li>
<li><a href="mbyte.html">mbyte</a></li>
<li><a href="mlang.html">mlang</a></li>
<li><a href="arabic.html">arabic</a></li>
<li><a href="farsi.html">farsi</a></li>
<li><a href="hebrew.html">hebrew</a></li>
<li><a href="russian.html">russian</a></li>
<li><a href="ft_ada.html">ft_ada</a></li>
<li><a href="ft_sql.html">ft_sql</a></li>
<li><a href="hangulin.html">hangulin</a></li>
<li><a href="rileft.html">rileft</a></li>
</ul></dd>
<dt>GUI</dt>
<dd><ul>
<li><a href="gui.html">gui</a></li>
<li><a href="gui_w32.html">gui_w32</a></li>
<li><a href="gui_x11.html">gui_x11</a></li>
</ul></dd>
<dt>Interfaces</dt>
<dd><ul>
<li><a href="if_cscop.html">if_cscop</a></li>
<li><a href="if_lua.html">if_lua</a></li>
<li><a href="if_mzsch.html">if_mzsch</a></li>
<li><a href="if_perl.html">if_perl</a></li>
<li><a href="if_pyth.html">if_pyth</a></li>
<li><a href="if_tcl.html">if_tcl</a></li>
<li><a href="if_ole.html">if_ole</a></li>
<li><a href="if_ruby.html">if_ruby</a></li>
<li><a href="debugger.html">debugger</a></li>
<li><a href="workshop.html">workshop</a></li>
<li><a href="netbeans.html">netbeans</a></li>
<li><a href="sign.html">sign</a></li>
</ul></dd>
<dt>Versions</dt>
<dd><ul>
<li><a href="vi_diff.html">vi_diff</a></li>
<li><a href="version4.html">version4</a></li>
<li><a href="version5.html">version5</a></li>
<li><a href="version6.html">version6</a></li>
<li><a href="version7.html">version7</a></li>
<li><a href="version8.html">version8</a></li>
</ul></dd>
<dt>Remarks about specific systems</dt>
<dd><ul>
<li><a href="os_390.html">os_390</a></li>
<li><a href="os_amiga.html">os_amiga</a></li>
<li><a href="os_beos.html">os_beos</a></li>
<li><a href="os_dos.html">os_dos</a></li>
<li><a href="os_mac.html">os_mac</a></li>
<li><a href="os_mint.html">os_mint</a></li>
<li><a href="os_msdos.html">os_msdos</a></li>
<li><a href="os_os2.html">os_os2</a></li>
<li><a href="os_qnx.html">os_qnx</a></li>
<li><a href="os_risc.html">os_risc</a></li>
<li><a href="os_unix.html">os_unix</a></li>
<li><a href="os_vms.html">os_vms</a></li>
<li><a href="os_win32.html">os_win32</a></li>
</ul></dd>
<dt>Standard plugins</dt>
<dd><ul>
<li><a href="pi_getscript.html">pi_getscript</a></li>
<li><a href="pi_gzip.html">pi_gzip</a></li>
<li><a href="pi_logipat.html">pi_logipat</a></li>
<li><a href="pi_netrw.html">pi_netrw</a></li>
<li><a href="pi_paren.html">pi_paren</a></li>
<li><a href="pi_tar.html">pi_tar</a></li>
<li><a href="pi_vimball.html">pi_vimball</a></li>
<li><a href="pi_zip.html">pi_zip</a></li>
</ul></dd>
<dt>Filetype plugins</dt>
<dd><ul>
<li><a href="pi_spec.html">pi_spec</a></li>
</ul></dd>
<dt>Others</dt>
<dd><ul>
<li><a href="vim_faq.html">vim_faq</a></li>
</ul></dd>
</dl>
</nav>
<article class="Vimdoc VimdocJa">
<div id='vimCodeElement'>
<a class="Constant" href="usr_20.html" name="usr_20.txt">usr_20.txt</a>&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;<span class="Identifier">Vim version 8.0.</span>&nbsp;&nbsp;Last change: 2006 Apr 24<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIM USER MANUAL - by Bram Moolenaar<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Typing command-line commands quickly<br>
<br>
<br>
Vim has a few generic features that makes it easier to enter commands.&nbsp;&nbsp;Colon<br>
commands can be abbreviated, edited and repeated.&nbsp;&nbsp;Completion is available for<br>
nearly everything.<br>
<br>
<a class="Identifier" href="usr_20.html#20.1">20.1</a>&nbsp;&nbsp;Command line editing<br>
<a class="Identifier" href="usr_20.html#20.2">20.2</a>&nbsp;&nbsp;Command line abbreviations<br>
<a class="Identifier" href="usr_20.html#20.3">20.3</a>&nbsp;&nbsp;Command line completion<br>
<a class="Identifier" href="usr_20.html#20.4">20.4</a>&nbsp;&nbsp;Command line history<br>
<a class="Identifier" href="usr_20.html#20.5">20.5</a>&nbsp;&nbsp;Command line window<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp; Next chapter:&nbsp;<a class="Identifier" href="usr_21.html">usr_21.txt</a>&nbsp;&nbsp;Go away and come back<br>
&nbsp;Previous chapter:&nbsp;<a class="Identifier" href="usr_12.html">usr_12.txt</a>&nbsp;&nbsp;Clever tricks<br>
Table of contents:&nbsp;<a class="Identifier" href="usr_toc.html">usr_toc.txt</a><br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_20.html#20.1" name="20.1">20.1</a>&nbsp;&nbsp;Command line editing<br>
<br>
When you use a colon (:) command or search for a string with / or ?, Vim puts<br>
the cursor on the bottom of the screen.&nbsp;&nbsp;There you type the command or search<br>
pattern.&nbsp;&nbsp;This is called the Command line.&nbsp;&nbsp;Also when it's used for entering a<br>
search command.<br>
<br>
The most obvious way to edit the command you type is by pressing the&nbsp;<span class="Special">&lt;BS&gt;</span>&nbsp;key.<br>
This erases the character before the cursor.&nbsp;&nbsp;To erase another character,<br>
typed earlier, first move the cursor with the cursor keys.<br>
&nbsp;&nbsp; For example, you have typed this:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:s/col/pig/</div>
<br>
Before you hit&nbsp;<span class="Special">&lt;Enter&gt;</span>, you notice that &quot;col&quot; should be &quot;cow&quot;.&nbsp;&nbsp;To correct<br>
this, you type&nbsp;<span class="Special">&lt;Left&gt;</span>&nbsp;five times.&nbsp;&nbsp;The cursor is now just after &quot;col&quot;.&nbsp;&nbsp;Type<br>
<span class="Special">&lt;BS&gt;</span>&nbsp;and &quot;w&quot; to correct:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:s/cow/pig/</div>
<br>
Now you can press&nbsp;<span class="Special">&lt;Enter&gt;</span>&nbsp;directly.&nbsp;&nbsp;You don't have to move the cursor to the<br>
end of the line before executing the command.<br>
<br>
The most often used keys to move around in the command line:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;Left&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;one character left<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;Right&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; one character right<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;S-Left&gt;</span>&nbsp;or&nbsp;<span class="Special">&lt;C-Left&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;one word left<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;S-Right&gt;</span>&nbsp;or&nbsp;<span class="Special">&lt;C-Right&gt;</span>&nbsp;&nbsp;one word right<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">CTRL-B</span>&nbsp;or&nbsp;<span class="Special">&lt;Home&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to begin of command line<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">CTRL-E</span>&nbsp;or&nbsp;<span class="Special">&lt;End&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to end of command line<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">Note</span>:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;S-Left&gt;</span>&nbsp;(cursor left key with Shift key pressed) and&nbsp;<span class="Special">&lt;C-Left&gt;</span>&nbsp;(cursor<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;left key with Control pressed) will not work on all keyboards.&nbsp;&nbsp;Same<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for the other Shift and Control combinations.<br>
<br>
You can also use the mouse to move the cursor.<br>
<br>
<br>
DELETING<br>
<br>
As mentioned,&nbsp;<span class="Special">&lt;BS&gt;</span>&nbsp;deletes the character before the cursor.&nbsp;&nbsp;To delete a whole<br>
word use&nbsp;<span class="Special">CTRL-W</span>.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">/the fine pig</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">CTRL-W</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">/the fine</span><br>
<br>
<span class="Special">CTRL-U</span>&nbsp;removes all text, thus allows you to start all over again.<br>
<br>
<br>
OVERSTRIKE<br>
<br>
The&nbsp;<span class="Special">&lt;Insert&gt;</span>&nbsp;key toggles between inserting characters and replacing the<br>
existing ones.&nbsp;&nbsp;Start with this text:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">/the fine pig</span><br>
<br>
Move the cursor to the start of &quot;fine&quot; with&nbsp;<span class="Special">&lt;S-Left&gt;</span>&nbsp;twice (or&nbsp;<span class="Special">&lt;Left&gt;</span>&nbsp;eight<br>
times, if&nbsp;<span class="Special">&lt;S-Left&gt;</span>&nbsp;doesn't work).&nbsp;&nbsp;Now press&nbsp;<span class="Special">&lt;Insert&gt;</span>&nbsp;to switch to overstrike<br>
and type &quot;great&quot;:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">/the greatpig</span><br>
<br>
Oops, we lost the space.&nbsp;&nbsp;Now, don't use&nbsp;<span class="Special">&lt;BS&gt;</span>, because it would delete the<br>
&quot;t&quot; (this is different from Replace mode).&nbsp;&nbsp;Instead, press&nbsp;<span class="Special">&lt;Insert&gt;</span>&nbsp;to switch<br>
from overstrike to inserting, and type the space:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">/the great pig</span><br>
<br>
<br>
CANCELLING<br>
<br>
You thought of executing a : or / command, but changed your mind.&nbsp;&nbsp;To get rid<br>
of what you already typed, without executing it, press&nbsp;<span class="Special">CTRL-C</span>&nbsp;or&nbsp;<span class="Special">&lt;Esc&gt;</span>.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">Note</span>:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;Esc&gt;</span>&nbsp;is the universal &quot;get out&quot; key.&nbsp;&nbsp;Unfortunately, in the good old<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vi pressing&nbsp;<span class="Special">&lt;Esc&gt;</span>&nbsp;in a command line executed the command!&nbsp;&nbsp;Since that<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;might be considered to be a bug, Vim uses&nbsp;<span class="Special">&lt;Esc&gt;</span>&nbsp;to cancel the command.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;But with the&nbsp;<a class="Type" href="options.html#'cpoptions'">'cpoptions'</a>&nbsp;option it can be made Vi compatible.&nbsp;&nbsp;And<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when using a mapping (which might be written for Vi)&nbsp;<span class="Special">&lt;Esc&gt;</span>&nbsp;also works<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vi compatible.&nbsp;&nbsp;Therefore, using&nbsp;<span class="Special">CTRL-C</span>&nbsp;is a method that always works.<br>
<br>
If you are at the start of the command line, pressing&nbsp;<span class="Special">&lt;BS&gt;</span>&nbsp;will cancel the<br>
command.&nbsp;&nbsp;It's like deleting the &quot;:&quot; or &quot;/&quot; that the line starts with.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_20.html#20.2" name="20.2">20.2</a>&nbsp;&nbsp;Command line abbreviations<br>
<br>
Some of the &quot;:&quot; commands are really long.&nbsp;&nbsp;We already mentioned that<br>
&quot;:substitute&quot; can be abbreviated to &quot;:s&quot;.&nbsp;&nbsp;This is a generic mechanism, all<br>
&quot;:&quot; commands can be abbreviated.<br>
<br>
How short can a command get?&nbsp;&nbsp;There are 26 letters, and many more commands.<br>
For example, &quot;:set&quot; also starts with &quot;:s&quot;, but &quot;:s&quot; doesn't start a &quot;:set&quot;<br>
command.&nbsp;&nbsp;Instead &quot;:set&quot; can be abbreviated to &quot;:se&quot;.<br>
&nbsp;&nbsp; When the shorter form of a command could be used for two commands, it<br>
stands for only one of them.&nbsp;&nbsp;There is no logic behind which one, you have to<br>
learn them.&nbsp;&nbsp;In the help files the shortest form that works is mentioned.&nbsp;&nbsp;For<br>
example:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:s[ubstitute]</div>
<br>
This means that the shortest form of &quot;:substitute&quot; is &quot;:s&quot;.&nbsp;&nbsp;The following<br>
characters are optional.&nbsp;&nbsp;Thus &quot;:su&quot; and &quot;:sub&quot; also work.<br>
<br>
In the user manual we will either use the full name of command, or a short<br>
version that is still readable.&nbsp;&nbsp;For example, &quot;:function&quot; can be abbreviated<br>
to &quot;:fu&quot;.&nbsp;&nbsp;But since most people don't understand what that stands for, we<br>
will use &quot;:fun&quot;.&nbsp;&nbsp;(Vim doesn't have a &quot;:funny&quot; command, otherwise &quot;:fun&quot; would<br>
be confusing too.)<br>
<br>
It is recommended that in Vim scripts you write the full command name.&nbsp;&nbsp;That<br>
makes it easier to read back when you make later changes.&nbsp;&nbsp;Except for some<br>
often used commands like &quot;:w&quot; (&quot;:write&quot;) and &quot;:r&quot; (&quot;:read&quot;).<br>
&nbsp;&nbsp; A particularly confusing one is &quot;:end&quot;, which could stand for &quot;:endif&quot;,<br>
&quot;:endwhile&quot; or &quot;:endfunction&quot;.&nbsp;&nbsp;Therefore, always use the full name.<br>
<br>
<br>
SHORT OPTION NAMES<br>
<br>
In the user manual the long version of the option names is used.&nbsp;&nbsp;Many options<br>
also have a short name.&nbsp;&nbsp;Unlike &quot;:&quot; commands, there is only one short name<br>
that works.&nbsp;&nbsp;For example, the short name of&nbsp;<a class="Type" href="options.html#'autoindent'">'autoindent'</a>&nbsp;is&nbsp;<a class="Type" href="options.html#'ai'">'ai'</a>.&nbsp;&nbsp;Thus these<br>
two commands do the same thing:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:set autoindent<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:set ai</div>
<br>
You can find the full list of long and short names here:&nbsp;<a class="Identifier" href="quickref.html#option-list">option-list</a>.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_20.html#20.3" name="20.3">20.3</a>&nbsp;&nbsp;Command line completion<br>
<br>
This is one of those Vim features that, by itself, is a reason to switch from<br>
Vi to Vim.&nbsp;&nbsp;Once you have used this, you can't do without.<br>
<br>
Suppose you have a directory that contains these files:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;info.txt<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;intro.txt<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bodyofthepaper.txt<br>
<br>
To edit the last one, you use the command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit bodyofthepaper.txt</div>
<br>
It's easy to type this wrong.&nbsp;&nbsp;A much quicker way is:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit b&lt;Tab&gt;</div>
<br>
Which will result in the same command.&nbsp;&nbsp;What happened?&nbsp;&nbsp;The&nbsp;<span class="Special">&lt;Tab&gt;</span>&nbsp;key does<br>
completion of the word before the cursor.&nbsp;&nbsp;In this case &quot;b&quot;.&nbsp;&nbsp;Vim looks in the<br>
directory and finds only one file that starts with a &quot;b&quot;.&nbsp;&nbsp;That must be the<br>
one you are looking for, thus Vim completes the file name for you.<br>
<br>
Now type:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit i&lt;Tab&gt;</div>
<br>
Vim will beep, and give you:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit info.txt</div>
<br>
The beep means that Vim has found more than one match.&nbsp;&nbsp;It then uses the first<br>
match it found (alphabetically).&nbsp;&nbsp;If you press&nbsp;<span class="Special">&lt;Tab&gt;</span>&nbsp;again, you get:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit intro.txt</div>
<br>
Thus, if the first&nbsp;<span class="Special">&lt;Tab&gt;</span>&nbsp;doesn't give you the file you were looking for, press<br>
it again.&nbsp;&nbsp;If there are more matches, you will see them all, one at a time.<br>
&nbsp;&nbsp; If you press&nbsp;<span class="Special">&lt;Tab&gt;</span>&nbsp;on the last matching entry, you will go back to what you<br>
first typed:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit i</div>
<br>
Then it starts all over again.&nbsp;&nbsp;Thus Vim cycles through the list of matches.<br>
Use&nbsp;<span class="Special">CTRL-P</span>&nbsp;to go through the list in the other direction:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;-------------------&nbsp;<span class="Special">&lt;Tab&gt;</span>&nbsp;-------------------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;Tab&gt;</span>&nbsp;--&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;Tab&gt;</span>&nbsp;--&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :edit info.txt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :edit intro.txt<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;--&nbsp;<span class="Special">CTRL-P</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;--&nbsp;<span class="Special">CTRL-P</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +----------------------&nbsp;<span class="Special">CTRL-P</span>&nbsp;------------------------&gt;<br>
<br>
<br>
CONTEXT<br>
<br>
When you type &quot;:set i&quot; instead of &quot;:edit i&quot; and press&nbsp;<span class="Special">&lt;Tab&gt;</span>&nbsp;you get:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:set icon</div>
<br>
Hey, why didn't you get &quot;:set info.txt&quot;?&nbsp;&nbsp;That's because Vim has context<br>
sensitive completion.&nbsp;&nbsp;The kind of words Vim will look for depends on the<br>
command before it.&nbsp;&nbsp;Vim knows that you cannot use a file name just after a<br>
&quot;:set&quot; command, but you can use an option name.<br>
&nbsp;&nbsp; Again, if you repeat typing the&nbsp;<span class="Special">&lt;Tab&gt;</span>, Vim will cycle through all matches.<br>
There are quite a few, it's better to type more characters first:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:set isk&lt;Tab&gt;</div>
<br>
Gives:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:set iskeyword</div>
<br>
Now type &quot;=&quot; and press&nbsp;<span class="Special">&lt;Tab&gt;</span>:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:set iskeyword=@,48-57,_,192-255</div>
<br>
What happens here is that Vim inserts the old value of the option.&nbsp;&nbsp;Now you<br>
can edit it.<br>
&nbsp;&nbsp; What is completed with&nbsp;<span class="Special">&lt;Tab&gt;</span>&nbsp;is what Vim expects in that place.&nbsp;&nbsp;Just try<br>
it out to see how it works.&nbsp;&nbsp;In some situations you will not get what you<br>
want.&nbsp;&nbsp;That's either because Vim doesn't know what you want, or because<br>
completion was not implemented for that situation.&nbsp;&nbsp;In that case you will get<br>
a&nbsp;<span class="Special">&lt;Tab&gt;</span>&nbsp;inserted (displayed as ^I).<br>
<br>
<br>
LIST MATCHES<br>
<br>
When there are many matches, you would like to see an overview.&nbsp;&nbsp;Do this by<br>
pressing&nbsp;<span class="Special">CTRL-D</span>.&nbsp;&nbsp;For example, pressing&nbsp;<span class="Special">CTRL-D</span>&nbsp;after:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:set is</div>
<br>
results in:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:set is<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;incsearch&nbsp;&nbsp;isfname&nbsp;&nbsp;&nbsp;&nbsp;isident&nbsp;&nbsp;&nbsp;&nbsp;iskeyword&nbsp;&nbsp;isprint<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:set is</div>
<br>
Vim lists the matches and then comes back with the text you typed.&nbsp;&nbsp;You can<br>
now check the list for the item you wanted.&nbsp;&nbsp;If it isn't there, you can use<br>
<span class="Special">&lt;BS&gt;</span>&nbsp;to correct the word.&nbsp;&nbsp;If there are many matches, type a few more<br>
characters before pressing&nbsp;<span class="Special">&lt;Tab&gt;</span>&nbsp;to complete the rest.<br>
&nbsp;&nbsp; If you have watched carefully, you will have noticed that &quot;incsearch&quot;<br>
doesn't start with &quot;is&quot;.&nbsp;&nbsp;In this case &quot;is&quot; stands for the short name of<br>
&quot;incsearch&quot;.&nbsp;&nbsp;(Many options have a short and a long name.)&nbsp;&nbsp;Vim is clever<br>
enough to know that you might have wanted to expand the short name of the<br>
option into the long name.<br>
<br>
<br>
THERE IS MORE<br>
<br>
The&nbsp;<span class="Special">CTRL-L</span>&nbsp;command completes the word to the longest unambiguous string.&nbsp;&nbsp;If<br>
you type &quot;:edit i&quot; and there are files &quot;info.txt&quot; and &quot;info_backup.txt&quot; you<br>
will get &quot;:edit info&quot;.<br>
<br>
The&nbsp;<a class="Type" href="options.html#'wildmode'">'wildmode'</a>&nbsp;option can be used to change the way completion works.<br>
The&nbsp;<a class="Type" href="options.html#'wildmenu'">'wildmenu'</a>&nbsp;option can be used to get a menu-like list of matches.<br>
Use the&nbsp;<a class="Type" href="options.html#'suffixes'">'suffixes'</a>&nbsp;option to specify files that are less important and appear<br>
at the end of the list of files.<br>
The&nbsp;<a class="Type" href="options.html#'wildignore'">'wildignore'</a>&nbsp;option specifies files that are not listed at all.<br>
<br>
More about all of this here:&nbsp;<a class="Identifier" href="cmdline.html#cmdline-completion">cmdline-completion</a><br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_20.html#20.4" name="20.4">20.4</a>&nbsp;&nbsp;Command line history<br>
<br>
In chapter 3 we briefly mentioned the history.&nbsp;&nbsp;The basics are that you can<br>
use the&nbsp;<span class="Special">&lt;Up&gt;</span>&nbsp;key to recall an older command line.&nbsp;&nbsp;<span class="Special">&lt;Down&gt;</span>&nbsp;then takes you back<br>
to newer commands.<br>
<br>
There are actually four histories.&nbsp;&nbsp;The ones we will mention here are for &quot;:&quot;<br>
commands and for &quot;/&quot; and &quot;?&quot; search commands.&nbsp;&nbsp;The &quot;/&quot; and &quot;?&quot; commands share<br>
the same history, because they are both search commands.&nbsp;&nbsp;The two other<br>
histories are for expressions and input lines for the input() function.<br>
<a class="Identifier" href="cmdline.html#cmdline-history">cmdline-history</a><br>
<br>
Suppose you have done a &quot;:set&quot; command, typed ten more colon commands and then<br>
want to repeat that &quot;:set&quot; command again.&nbsp;&nbsp;You could press &quot;:&quot; and then ten<br>
times&nbsp;<span class="Special">&lt;Up&gt;</span>.&nbsp;&nbsp;There is a quicker way:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:se&lt;Up&gt;</div>
<br>
Vim will now go back to the previous command that started with &quot;se&quot;.&nbsp;&nbsp;You have<br>
a good chance that this is the &quot;:set&quot; command you were looking for.&nbsp;&nbsp;At least<br>
you should not have to press&nbsp;<span class="Special">&lt;Up&gt;</span>&nbsp;very often (unless &quot;:set&quot; commands is all<br>
you have done).<br>
<br>
The&nbsp;<span class="Special">&lt;Up&gt;</span>&nbsp;key will use the text typed so far and compare it with the lines in<br>
the history.&nbsp;&nbsp;Only matching lines will be used.<br>
&nbsp;&nbsp; If you do not find the line you were looking for, use&nbsp;<span class="Special">&lt;Down&gt;</span>&nbsp;to go back to<br>
what you typed and correct that.&nbsp;&nbsp;Or use&nbsp;<span class="Special">CTRL-U</span>&nbsp;to start all over again.<br>
<br>
To see all the lines in the history:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:history</div>
<br>
That's the history of &quot;:&quot; commands.&nbsp;&nbsp;The search history is displayed with this<br>
command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:history /</div>
<br>
<span class="Special">CTRL-P</span>&nbsp;will work like&nbsp;<span class="Special">&lt;Up&gt;</span>, except that it doesn't matter what you already<br>
typed.&nbsp;&nbsp;Similarly for&nbsp;<span class="Special">CTRL-N</span>&nbsp;and&nbsp;<span class="Special">&lt;Down&gt;</span>.&nbsp;&nbsp;<span class="Special">CTRL-P</span>&nbsp;stands for previous,&nbsp;<span class="Special">CTRL-N</span><br>
for next.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_20.html#20.5" name="20.5">20.5</a>&nbsp;&nbsp;Command line window<br>
<br>
Typing the text in the command line works different from typing text in Insert<br>
mode.&nbsp;&nbsp;It doesn't allow many commands to change the text.&nbsp;&nbsp;For most commands<br>
that's OK, but sometimes you have to type a complicated command.&nbsp;&nbsp;That's where<br>
the command line window is useful.<br>
<br>
Open the command line window with this command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q:</div>
<br>
Vim now opens a (small) window at the bottom.&nbsp;&nbsp;It contains the command line<br>
history, and an empty line at the end:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+-------------------------------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|other window&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|file.txt=============================|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|:e c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|:e config.h.in&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|:set path=.,/usr/include,,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|:set iskeyword=@,48-57,_,192-255&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|:set is&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|:q&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|command-line=========================|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+-------------------------------------+<br>
<br>
You are now in Normal mode.&nbsp;&nbsp;You can use the &quot;hjkl&quot; keys to move around.&nbsp;&nbsp;For<br>
example, move up with &quot;5k&quot; to the &quot;:e config.h.in&quot; line.&nbsp;&nbsp;Type &quot;$h&quot; to go to<br>
the &quot;i&quot; of &quot;in&quot; and type &quot;cwout&quot;.&nbsp;&nbsp;Now you have changed the line to:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">:e config.h.out</span><br>
<br>
Now press&nbsp;<span class="Special">&lt;Enter&gt;</span>&nbsp;and this command will be executed.&nbsp;&nbsp;The command line window<br>
will close.<br>
&nbsp;&nbsp; The&nbsp;<span class="Special">&lt;Enter&gt;</span>&nbsp;command will execute the line under the cursor.&nbsp;&nbsp;It doesn't<br>
matter whether Vim is in Insert mode or in Normal mode.<br>
&nbsp;&nbsp; Changes in the command line window are lost.&nbsp;&nbsp;They do not result in the<br>
history to be changed.&nbsp;&nbsp;Except that the command you execute will be added to<br>
the end of the history, like with all executed commands.<br>
<br>
The command line window is very useful when you want to have overview of the<br>
history, lookup a similar command, change it a bit and execute it.&nbsp;&nbsp;A search<br>
command can be used to find something.<br>
&nbsp;&nbsp; In the previous example the &quot;?config&quot; search command could have been used<br>
to find the previous command that contains &quot;config&quot;.&nbsp;&nbsp;It's a bit strange,<br>
because you are using a command line to search in the command line window.<br>
While typing that search command you can't open another command line window,<br>
there can be only one.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<br>
Next chapter:&nbsp;<a class="Identifier" href="usr_21.html">usr_21.txt</a>&nbsp;&nbsp;Go away and come back<br>
<br>
Copyright: see&nbsp;<a class="Identifier" href="usr_01.html#manual-copyright">manual-copyright</a>&nbsp;&nbsp;vim:tw=78:ts=8:ft=help:norl:<br>
</div>
</article>
<footer>
<a href="#top">Return to the top</a> - <a href="index.html">Return to main</a>
<span class="EnglishJapaneseLink">
<span class="CurrentLanguage">English</span>
</span>
<br />
<div style="text-align:right;">
Hosted by <a href="https://github.com/vim-jp/vimdoc-en">vimdoc-en project</a><br />
If you met any problem, please report it to <a href="https://github.com/vim-jp/vimdoc-en/issues">issue</a>.<br />
</div>
</footer>
<!--<script src="js/check-referrer.js" type="text/javascript"></script>-->
</body>
</html>
<!-- vim:set ts=8 sts=2 sw=2 tw=0 et: -->
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hilarryxu/vimdoc.git
git@gitee.com:hilarryxu/vimdoc.git
hilarryxu
vimdoc
vimdoc
master

搜索帮助