1 Star 0 Fork 0

hilarryxu/vimdoc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
usr_22.html 37.76 KB
一键复制 编辑 原始数据 按行查看 历史
hilarryxu 提交于 2017-08-15 10:58 . Init repo
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>usr_22 - 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_22<br />
<a name="top"></a><h1>usr_22 - 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_22.html" name="usr_22.txt">usr_22.txt</a>&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;<span class="Identifier">Vim version 8.0.</span>&nbsp;&nbsp;Last change: 2016 Dec 13<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Finding the file to edit<br>
<br>
<br>
Files can be found everywhere.&nbsp;&nbsp;So how do you find them?&nbsp;&nbsp;Vim offers various<br>
ways to browse the directory tree.&nbsp;&nbsp;There are commands to jump to a file that<br>
is mentioned in another.&nbsp;&nbsp;And Vim remembers which files have been edited<br>
before.<br>
<br>
<a class="Identifier" href="usr_22.html#22.1">22.1</a>&nbsp;&nbsp;The file browser<br>
<a class="Identifier" href="usr_22.html#22.2">22.2</a>&nbsp;&nbsp;The current directory<br>
<a class="Identifier" href="usr_22.html#22.3">22.3</a>&nbsp;&nbsp;Finding a file<br>
<a class="Identifier" href="usr_22.html#22.4">22.4</a>&nbsp;&nbsp;The buffer list<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp; Next chapter:&nbsp;<a class="Identifier" href="usr_23.html">usr_23.txt</a>&nbsp;&nbsp;Editing other files<br>
&nbsp;Previous chapter:&nbsp;<a class="Identifier" href="usr_21.html">usr_21.txt</a>&nbsp;&nbsp;Go away and come back<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_22.html#22.1" name="22.1">22.1</a>&nbsp;&nbsp;The file browser<br>
<br>
Vim has a plugin that makes it possible to edit a directory.&nbsp;&nbsp;Try this:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit .</div>
<br>
Through the magic of autocommands and Vim scripts, the window will be filled<br>
with the contents of the directory.&nbsp;&nbsp;It looks like this:<br>
<br>
<span class="PreProc">&quot; ============================================================================</span><br>
<span class="PreProc">&quot; Netrw Directory Listing&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;(netrw v109)</span><br>
<span class="PreProc">&quot;&nbsp;&nbsp; Sorted by&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name</span><br>
<span class="PreProc">&quot;&nbsp;&nbsp; Sort sequence: [\/]$,\.h$,\.c$,\.cpp$,*,\.info$,\.swp$,\.o$\.obj$,\.bak$</span><br>
<span class="PreProc">&quot;&nbsp;&nbsp; Quick Help: &lt;F1&gt;:help&nbsp;&nbsp;-:go up dir&nbsp;&nbsp;D:delete&nbsp;&nbsp;R:rename&nbsp;&nbsp;s:sort-by&nbsp;&nbsp;x:exec</span><br>
<span class="PreProc">&quot; ============================================================================</span><br>
<span class="PreProc">../</span><br>
<span class="PreProc">./</span><br>
<span class="PreProc">check/</span><br>
<span class="PreProc">Makefile</span><br>
<span class="PreProc">autocmd.txt</span><br>
<span class="PreProc">change.txt</span><br>
<span class="PreProc">eval.txt~</span><br>
<span class="PreProc">filetype.txt~</span><br>
<span class="PreProc">help.txt.info</span><br>
<br>
You can see these items:<br>
<br>
1.&nbsp;&nbsp;The name of the browsing tool and its version number<br>
2.&nbsp;&nbsp;The name of the browsing directory<br>
3.&nbsp;&nbsp;The method of sorting (may be by name, time, or size)<br>
4.&nbsp;&nbsp;How names are to be sorted (directories first, then *.h files,<br>
<span class="Statement">&nbsp;&nbsp;&nbsp;&nbsp;</span>*.c files, etc)<br>
5.&nbsp;&nbsp;How to get help (use the&nbsp;<span class="Special">&lt;F1&gt;</span>&nbsp;key), and an abbreviated listing<br>
&nbsp;&nbsp;&nbsp;&nbsp;of available commands<br>
6.&nbsp;&nbsp;A listing of files, including &quot;../&quot;, which allows one to list<br>
&nbsp;&nbsp;&nbsp;&nbsp;the parent directory.<br>
<br>
If you have syntax highlighting enabled, the different parts are highlighted<br>
so as to make it easier to spot them.<br>
<br>
You can use Normal mode Vim commands to move around in the text.&nbsp;&nbsp;For example,<br>
move the cursor atop a file and press&nbsp;<span class="Special">&lt;Enter&gt;</span>; you will then be editing that<br>
file.&nbsp;&nbsp;To go back to the browser use &quot;:edit .&quot; again, or use &quot;:Explore&quot;.<br>
<span class="Special">CTRL-O</span>&nbsp;also works.<br>
<br>
Try using&nbsp;<span class="Special">&lt;Enter&gt;</span>&nbsp;while the cursor is atop a directory name.&nbsp;&nbsp;The result is<br>
that the file browser moves into that directory and displays the items found<br>
there.&nbsp;&nbsp;Pressing&nbsp;<span class="Special">&lt;Enter&gt;</span>&nbsp;on the first directory &quot;../&quot; moves you one level<br>
higher.&nbsp;&nbsp;Pressing &quot;-&quot; does the same thing, without the need to move to the<br>
&quot;../&quot; item first.<br>
<br>
You can press&nbsp;<span class="Special">&lt;F1&gt;</span>&nbsp;to get help on the things you can do in the netrw file<br>
browser.&nbsp;&nbsp;This is what you get:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;9. Directory Browsing&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;netrw-browse&nbsp;&nbsp; netrw-dir&nbsp;&nbsp; netrw-list&nbsp;&nbsp; netrw-help&nbsp;</div>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;MAPS&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; netrw-maps&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;F1&gt;.............Help.......................................|netrw-help|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;cr&gt;.............Browsing...................................|netrw-cr|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;del&gt;............Deleting Files or Directories..............|netrw-delete|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -................Going Up...................................|netrw--|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a................Hiding Files or Directories................|netrw-a|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mb...............Bookmarking a Directory....................|netrw-mb|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gb...............Changing to a Bookmarked Directory.........|netrw-gb|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c................Make Browsing Directory The Current Dir....|netrw-c|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d................Make A New Directory.......................|netrw-d|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; D................Deleting Files or Directories..............|netrw-D|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;c-h&gt;............Edit File/Directory Hiding List............|netrw-ctrl-h|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i................Change Listing Style.......................|netrw-i|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;c-l&gt;............Refreshing the Listing.....................|netrw-ctrl-l|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o................Browsing with a Horizontal Split...........|netrw-o|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p................Use Preview Window.........................|netrw-p|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; P................Edit in Previous Window....................|netrw-p|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; q................Listing Bookmarks and History..............|netrw-qb|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r................Reversing Sorting Order....................|netrw-r|</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (etc)<br>
<br>
The&nbsp;<span class="Special">&lt;F1&gt;</span>&nbsp;key thus brings you to a netrw directory browsing contents help page.<br>
It's a regular help page; use the usual&nbsp;<a class="Identifier" href="tagsrch.html#CTRL-]">CTRL-]</a>&nbsp;to jump to tagged help items<br>
and&nbsp;<a class="Identifier" href="motion.html#CTRL-O">CTRL-O</a>&nbsp;to jump back.<br>
<br>
To select files for display and editing: (with the cursor is atop a filename)<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;enter&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Open the file in the current window.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pi_netrw.html#netrw-cr">netrw-cr</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Horizontally split window and display file&nbsp;<a class="Identifier" href="pi_netrw.html#netrw-o">netrw-o</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Vertically split window and display file&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pi_netrw.html#netrw-v">netrw-v</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Use the&nbsp;<a class="Identifier" href="windows.html#preview-window">preview-window</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pi_netrw.html#netrw-p">netrw-p</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;P&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edit in the previous window&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pi_netrw.html#netrw-P">netrw-P</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Open file in a new tab&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pi_netrw.html#netrw-t">netrw-t</a><br>
<br>
The following normal-mode commands may be used to control the browser display:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Controls listing style (thin, long, wide, and tree).<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;The long listing includes size and date information.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Repeatedly pressing s will change the way the files<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;are sorted; one may sort on name, modification time,<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;or size.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Reverse the sorting order.<br>
<br>
As a sampling of extra normal-mode commands:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Change Vim's notion of the current directory to be<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;the same as the browser directory.&nbsp;&nbsp;(see<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;<a class="Identifier" href="pi_netrw.html#g:netrw_keepdir">g:netrw_keepdir</a>&nbsp;to control this, too)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;R&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Rename the file or directory under the cursor; a<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;prompt will be issued for the new name.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;D&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Delete the file or directory under the cursor; a<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;confirmation request will be issued.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mb gb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Make bookmark/goto bookmark<br>
<br>
<br>
One may also use command mode; again, just a sampling:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:Explore&nbsp;<span class="Special">[directory]</span>&nbsp;&nbsp;&nbsp;&nbsp;Browse specified/current directory<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:NetrwSettings&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A comprehensive list of your current netrw<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;settings with help linkage.<br>
<br>
The netrw browser is not limited to just your local machine; one may use<br>
urls such as:&nbsp;&nbsp;&nbsp;&nbsp;(that trailing / is important)<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:Explore&nbsp;<span class="Constant">ftp://somehost/path/to/dir/</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:e scp://somehost/path/to/dir/<br>
<br>
See&nbsp;<a class="Identifier" href="pi_netrw.html#netrw-browse">netrw-browse</a>&nbsp;for more.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_22.html#22.2" name="22.2">22.2</a>&nbsp;&nbsp;The current directory<br>
<br>
Just like the shell, Vim has the concept of a current directory.&nbsp;&nbsp;Suppose you<br>
are in your home directory and want to edit several files in a directory<br>
&quot;VeryLongFileName&quot;.&nbsp;&nbsp;You could do:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit VeryLongFileName/file1.txt<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit VeryLongFileName/file2.txt<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit VeryLongFileName/file3.txt</div>
<br>
To avoid much of the typing, do this:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cd VeryLongFileName<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit file1.txt<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit file2.txt<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit file3.txt</div>
<br>
The &quot;:cd&quot; command changes the current directory.&nbsp;&nbsp;You can see what the current<br>
directory is with the &quot;:pwd&quot; command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:pwd<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/home/Bram/VeryLongFileName</div>
<br>
Vim remembers the last directory that you used.&nbsp;&nbsp;Use &quot;cd -&quot; to go back to it.<br>
Example:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:pwd<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/home/Bram/VeryLongFileName<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cd /etc<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:pwd<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/etc<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cd -<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:pwd<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/home/Bram/VeryLongFileName<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cd -<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:pwd<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/etc</div>
<br>
<br>
WINDOW LOCAL DIRECTORY<br>
<br>
When you split a window, both windows use the same current directory.&nbsp;&nbsp;When<br>
you want to edit a number of files somewhere else in the new window, you can<br>
make it use a different directory, without changing the current directory in<br>
the other window.&nbsp;&nbsp;This is called a local directory.<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:pwd<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/home/Bram/VeryLongFileName<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:split<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:lcd /etc<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:pwd<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/etc<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CTRL-W w<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:pwd<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/home/Bram/VeryLongFileName</div>
<br>
So long as no &quot;:lcd&quot; command has been used, all windows share the same current<br>
directory.&nbsp;&nbsp;Doing a &quot;:cd&quot; command in one window will also change the current<br>
directory of the other window.<br>
&nbsp;&nbsp; For a window where &quot;:lcd&quot; has been used a different current directory is<br>
remembered.&nbsp;&nbsp;Using &quot;:cd&quot; or &quot;:lcd&quot; in other windows will not change it.<br>
&nbsp;&nbsp; When using a &quot;:cd&quot; command in a window that uses a different current<br>
directory, it will go back to using the shared directory.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_22.html#22.3" name="22.3">22.3</a>&nbsp;&nbsp;Finding a file<br>
<br>
You are editing a C program that contains this line:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">#include &quot;inits.h&quot;</span><br>
<br>
You want to see what is in that &quot;inits.h&quot; file.&nbsp;&nbsp;Move the cursor on the name<br>
of the file and type:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gf</div>
<br>
Vim will find the file and edit it.<br>
&nbsp;&nbsp; What if the file is not in the current directory?&nbsp;&nbsp;Vim will use the&nbsp;<a class="Type" href="options.html#'path'">'path'</a><br>
option to find the file.&nbsp;&nbsp;This option is a list of directory names where to<br>
look for your file.<br>
&nbsp;&nbsp; Suppose you have your include files located in &quot;c:/prog/include&quot;.&nbsp;&nbsp;This<br>
command will add it to the&nbsp;<a class="Type" href="options.html#'path'">'path'</a>&nbsp;option:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:set path+=c:/prog/include</div>
<br>
This directory is an absolute path.&nbsp;&nbsp;No matter where you are, it will be the<br>
same place.&nbsp;&nbsp;What if you have located files in a subdirectory, below where the<br>
file is?&nbsp;&nbsp;Then you can specify a relative path name.&nbsp;&nbsp;This starts with a dot:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:set path+=./proto</div>
<br>
This tells Vim to look in the directory &quot;proto&quot;, below the directory where the<br>
file in which you use &quot;gf&quot; is.&nbsp;&nbsp;Thus using &quot;gf&quot; on &quot;inits.h&quot; will make Vim<br>
look for &quot;proto/inits.h&quot;, starting in the directory of the file.<br>
&nbsp;&nbsp; Without the &quot;./&quot;, thus &quot;proto&quot;, Vim would look in the &quot;proto&quot; directory<br>
below the current directory.&nbsp;&nbsp;And the current directory might not be where the<br>
file that you are editing is located.<br>
<br>
The&nbsp;<a class="Type" href="options.html#'path'">'path'</a>&nbsp;option allows specifying the directories where to search for files<br>
in many more ways.&nbsp;&nbsp;See the help on the&nbsp;<a class="Type" href="options.html#'path'">'path'</a>&nbsp;option.<br>
&nbsp;&nbsp; The&nbsp;<a class="Type" href="options.html#'isfname'">'isfname'</a>&nbsp;option is used to decide which characters are included in the<br>
file name, and which ones are not (e.g., the &quot; character in the example<br>
above).<br>
<br>
When you know the file name, but it's not to be found in the file, you can<br>
type it:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:find inits.h</div>
<br>
Vim will then use the&nbsp;<a class="Type" href="options.html#'path'">'path'</a>&nbsp;option to try and locate the file.&nbsp;&nbsp;This is the<br>
same as the &quot;:edit&quot; command, except for the use of&nbsp;<a class="Type" href="options.html#'path'">'path'</a>.<br>
<br>
To open the found file in a new window use&nbsp;<span class="Special">CTRL-W</span>&nbsp;f instead of &quot;gf&quot;, or use<br>
&quot;:sfind&quot; instead of &quot;:find&quot;.<br>
<br>
<br>
A nice way to directly start Vim to edit a file somewhere in the&nbsp;<a class="Type" href="options.html#'path'">'path'</a>:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vim &quot;+find stdio.h&quot;</div>
<br>
This finds the file &quot;stdio.h&quot; in your value of&nbsp;<a class="Type" href="options.html#'path'">'path'</a>.&nbsp;&nbsp;The quotes are<br>
necessary to have one argument&nbsp;<a class="Identifier" href="starting.html#-+c">-+c</a>.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_22.html#22.4" name="22.4">22.4</a>&nbsp;&nbsp;The buffer list<br>
<br>
The Vim editor uses the term buffer to describe a file being edited.<br>
Actually, a buffer is a copy of the file that you edit.&nbsp;&nbsp;When you finish<br>
changing the buffer, you write the contents of the buffer to the file.<br>
Buffers not only contain file contents, but also all the marks, settings, and<br>
other stuff that goes with it.<br>
<br>
<br>
HIDDEN BUFFERS<br>
<br>
Suppose you are editing the file one.txt and need to edit the file two.txt.<br>
You could simply use &quot;:edit two.txt&quot;, but since you made changes to one.txt<br>
that won't work.&nbsp;&nbsp;You also don't want to write one.txt yet.&nbsp;&nbsp;Vim has a<br>
solution for you:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:hide edit two.txt</div>
<br>
The buffer &quot;one.txt&quot; disappears from the screen, but Vim still knows that you<br>
are editing this buffer, so it keeps the modified text.&nbsp;&nbsp;This is called a<br>
hidden buffer: The buffer contains text, but you can't see it.<br>
&nbsp;&nbsp; The argument of &quot;:hide&quot; is another command.&nbsp;&nbsp;&quot;:hide&quot; makes that command<br>
behave as if the&nbsp;<a class="Type" href="options.html#'hidden'">'hidden'</a>&nbsp;option was set.&nbsp;&nbsp;You could also set this option<br>
yourself.&nbsp;&nbsp;The effect is that when any buffer is abandoned, it becomes hidden.<br>
&nbsp;&nbsp; Be careful!&nbsp;&nbsp;When you have hidden buffers with changes, don't exit Vim<br>
without making sure you have saved all the buffers.<br>
<br>
<br>
INACTIVE BUFFERS<br>
<br>
&nbsp;&nbsp; When a buffer has been used once, Vim remembers some information about it.<br>
When it is not displayed in a window and it is not hidden, it is still in the<br>
buffer list.&nbsp;&nbsp;This is called an inactive buffer.&nbsp;&nbsp;Overview:<br>
<br>
&nbsp;&nbsp; Active&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Appears in a window, text loaded.<br>
&nbsp;&nbsp; Hidden&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Not in a window, text loaded.<br>
&nbsp;&nbsp; Inactive&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Not in a window, no text loaded.<br>
<br>
The inactive buffers are remembered, because Vim keeps information about them,<br>
like marks.&nbsp;&nbsp;And remembering the file name is useful too, so that you can see<br>
which files you have edited.&nbsp;&nbsp;And edit them again.<br>
<br>
<br>
LISTING BUFFERS<br>
<br>
View the buffer list with this command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:buffers</div>
<br>
A command which does the same, is not so obvious to list buffers, but is much<br>
shorter to type:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:ls</div>
<br>
The output could look like this:<br>
<br>
&nbsp;&nbsp;<span class="PreProc">1 #h&nbsp;&nbsp; &quot;help.txt&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; line 62</span><br>
&nbsp;&nbsp;<span class="PreProc">2 %a + &quot;usr_21.txt&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; line 1</span><br>
&nbsp;&nbsp;<span class="PreProc">3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;usr_toc.txt&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line 1</span><br>
<br>
The first column contains the buffer number.&nbsp;&nbsp;You can use this to edit the<br>
buffer without having to type the name, see below.<br>
&nbsp;&nbsp; After the buffer number come the flags.&nbsp;&nbsp;Then the name of the file<br>
and the line number where the cursor was the last time.<br>
&nbsp;&nbsp; The flags that can appear are these (from left to right):<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;u&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Buffer is unlisted&nbsp;<a class="Identifier" href="windows.html#unlisted-buffer">unlisted-buffer</a>.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; %&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Current buffer.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Alternate buffer.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;&nbsp;&nbsp;&nbsp; Buffer is loaded and displayed.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;h&nbsp;&nbsp;&nbsp;&nbsp; Buffer is loaded but hidden.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp;&nbsp;Buffer is read-only.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp;&nbsp;&nbsp;&nbsp;Buffer is not modifiable, the&nbsp;<a class="Type" href="options.html#'modifiable'">'modifiable'</a>&nbsp;option is off.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;&nbsp; Buffer has been modified.<br>
<br>
<br>
EDITING A BUFFER<br>
<br>
You can edit a buffer by its number.&nbsp;&nbsp;That avoids having to type the file<br>
name:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:buffer 2</div>
<br>
But the only way to know the number is by looking in the buffer list.&nbsp;&nbsp;You can<br>
use the name, or part of it, instead:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:buffer help</div>
<br>
Vim will find the best match for the name you type.&nbsp;&nbsp;If there is only one<br>
buffer that matches the name, it will be used.&nbsp;&nbsp;In this case &quot;help.txt&quot;.<br>
&nbsp;&nbsp; To open a buffer in a new window:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:sbuffer 3</div>
<br>
This works with a name as well.<br>
<br>
<br>
USING THE BUFFER LIST<br>
<br>
You can move around in the buffer list with these commands:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:bnext&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;go to next buffer<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:bprevious&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;go to previous buffer<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:bfirst&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; go to the first buffer<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:blast&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;go to the last buffer<br>
<br>
To remove a buffer from the list, use this command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:bdelete 3</div>
<br>
Again, this also works with a name.<br>
&nbsp;&nbsp; If you delete a buffer that was active (visible in a window), that window<br>
will be closed.&nbsp;&nbsp;If you delete the current buffer, the current window will be<br>
closed.&nbsp;&nbsp;If it was the last window, Vim will find another buffer to edit.&nbsp;&nbsp;You<br>
can't be editing nothing!<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">Note</span>:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Even after removing the buffer with &quot;:bdelete&quot; Vim still remembers it.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;It's actually made &quot;unlisted&quot;, it no longer appears in the list from<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;:buffers&quot;.&nbsp;&nbsp;The &quot;:buffers!&quot; command will list unlisted buffers (yes,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vim can do the impossible).&nbsp;&nbsp;To really make Vim forget about a buffer,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;use &quot;:bwipe&quot;.&nbsp;&nbsp;Also see the&nbsp;<a class="Type" href="options.html#'buflisted'">'buflisted'</a>&nbsp;option.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<br>
Next chapter:&nbsp;<a class="Identifier" href="usr_23.html">usr_23.txt</a>&nbsp;&nbsp;Editing other files<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

搜索帮助