Skip to content

Commit d2c385b

Browse files
committed
appendix
1 parent b6b90bd commit d2c385b

2 files changed

Lines changed: 96 additions & 95 deletions

File tree

learn-vim-Appendix-Commands.html

Lines changed: 90 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,9 @@ <h3><a id="Movement-Commands">移动命令 Movement Commands</a></h3>
229229
<tr><td><code>m{x}</code></td><td>定义标记 Mark current position as <em>x</em></td></tr>
230230
<tr><td><code>`{x}</code></td><td>跳转到指定标记 (Backquote) Moves the cursor to the character marked by <em>x</em></td></tr>
231231
<tr><td><code>``</code></td><td>(Backquotes) Returns to the exact position of the previous mark or context after a move</td></tr>
232-
<tr><td><code>`"</code></td><td>跳转到上次离开这个文件时的位置 go to the position when last editing this file</td></tr>
232+
<tr><td><code>`"</code></td><td>(Backquotes) 跳转到上次离开这个文件时的位置 go to the position when last editing this file</td></tr>
233+
<tr><td><code>`&lt;</code></td><td>(Backquotes) 跳转到上一可视化区域的开头 go to the start of the (previous) Visual area</td></tr>
234+
<tr><td><code>`&gt;</code></td><td>(Backquotes) 跳转到上一可视化区域的结尾 go to the end of the (previous) Visual area</td></tr>
233235
<tr><td><code></code></td><td></td></tr>
234236

235237
<tr><td><code>'x</code></td><td>(Apostrophe) Moves the cursor to the first character of the line marked by <em>x</em></td></tr>
@@ -509,14 +511,14 @@ <h3><a id="Window-Commands">窗口命令 Window commands</a></h3>
509511
<tr><td><code class="inset">:sfind</code></td><td><code class="inset"></code></td><td>Split window and open file (if specified) in the new window.Look for file in the path.</td></tr>
510512
<tr><td><code class="inset">:vsplit</code></td><td><code class="inset">^Wv</code></td><td>Split current window into two from top to bottom and open file (if specified) in the new window.</td></tr>
511513
<tr><td><code class="inset">:vnew</code></td><td><code class="inset"></code></td><td>Vertical version of :new.</td></tr>
514+
<tr><td><code>Ctrl-W]</code></td><td>Split window and jump to tag under cursor</td></tr>
515+
<tr><td><code class="inset">Ctrl-Wf</code></td><td>拆分窗口并编辑光标下的文件 Split window and edit file name under the cursor</td></tr>
516+
<tr><td><code class="inset">Ctrl-W^</code></td><td>Split window and edit alternate file</td></tr>
512517
<tr><td><code class="inset">:close</code></td><td></td><td>关闭当前窗口</td></tr>
518+
<tr><td><code class="inset">Ctrl-Wq</code></td><td>退出编辑并关闭窗口 Quit editing and close window</td></tr>
513519
</tbody>
514520
</table>
515521

516-
<tr><td><code class="inset">Ctrl-Wq</code></td><td>退出编辑并关闭窗口 Quit editing and close window</td></tr>
517-
<tr><td><code class="inset"></code></td><td></td></tr>
518-
<tr><td><code class="inset"></code></td><td></td></tr>
519-
520522
<table border="0">
521523
<caption style="margin:0.5em; font-weight:bold">Commands to change position and layout</caption>
522524
<tbody><tr><th>Command</th><th>Action</th></tr>
@@ -652,6 +654,21 @@ <h3><a id="Abbreviations"><em>缩写 Abbreviations</em></a></h3>
652654
</tbody>
653655
</table>
654656

657+
<h2>可视化模式 Visual Mode</h2>
658+
<table border="0">
659+
<tbody>
660+
<tr><td><code>v</code></td><td>进入字符可视化模式(Characterwise visual mode)</td></tr>
661+
<tr><td><code>V</code></td><td>进入行可视化模式(Linewise visual mode)</td></tr>
662+
<tr><td><code>CTRL-V<br />CTRL-Q</code></td><td>进入的块可视化模式(Blockwise visual mode)</td></tr>
663+
<tr><td><code>gv</code></td><td>重复前一次可视化模式的选择 highlighting on previous visual are</td></tr>
664+
<tr><td><code>o</code></td><td>跳到高亮文本的另一端 (Other) exchange cursor position with start of highlighting</td></tr>
665+
<tr><td><code>O</code></td><td>跳到高亮文本的另一端。同 "o" 命令相似,但是在列块模式
666+
下,光标移动到水平方向的另一个角。</td></tr>
667+
<tr><td><code>{visual}!{command}&lt;CR&gt;</code></td><td>过滤所选区域 filter the highlighted lines through {command}</td></tr>
668+
<tr><td><code></code></td><td></td></tr>
669+
<tr><td><code></code></td><td></td></tr>
670+
</tbody></table>
671+
655672
<table border="0">
656673
<tbody>
657674
<tr><td><code></code></td><td></td></tr>
@@ -958,18 +975,9 @@ <h2><em>Metacharacters Used in Replacement Strings</em></h2>
958975
command. This is useful for repeating an edit.</td>
959976
</tr>
960977
<tr>
961-
<td valign="top"><code>\u or
962-
\l&nbsp;</code></td>
963-
<td valign="top">Changes the next character in the
964-
replacement string to upper- or lowercase, respectively.</td>
965-
</tr>
966-
<tr>
967-
<td valign="top"><code>\U&nbsp;or&nbsp;\L,&nbsp;<br>
978+
<td valign="top">
968979
\e&nbsp;or&nbsp;\E&nbsp;</code></td>
969-
<td valign="top"><code>\U</code>
970-
and <code>\L</code> are
971-
similar to <code>\u</code> or
972-
<code>\l</code>, but all
980+
but all
973981
following characters are converted to upper- or lowercase
974982
until the end of the replacement string or until <code>\E</code>, all characters of the
975983
replacement text affected by the <code>\L</code>.</td>
@@ -978,15 +986,9 @@ <h2><em>Metacharacters Used in Replacement Strings</em></h2>
978986

979987
<table border="1" cellpadding="3">
980988
<tbody><tr>
981-
<td style="background:#cccccc"><tt>Shortcut</tt></td>
982-
983-
<td bgcolor="#cccccc"><b><tt>Equivalent
984-
<br>
985-
Character
986-
<br>
987-
Set</tt></b></td>
988-
989-
<td bgcolor="#cccccc">What it matches</td>
989+
<td><tt>Shortcut</tt></td>
990+
<td><tt>Equivalent Character<br>Set</tt></b></td>
991+
<td>What it matches</td>
990992
</tr>
991993

992994
<tr>
@@ -1037,46 +1039,28 @@ <h2><em>Metacharacters Used in Replacement Strings</em></h2>
10371039
<td>"word separator" : i.e. space or punctuation, also
10381040
not EOL or BOL</td>
10391041
</tr><tr>
1040-
<td valign="top">\l<br>
1041-
</td>
1042-
<td valign="top">[a-z]<br>
1043-
</td>
1044-
<td valign="top">Lowercase
1045-
letter. In the search expression it matches any lower case letter. In the
1046-
replace expression it lowercases the character or character representer following
1047-
it.<br>
1042+
<td>\l<br></td>
1043+
<td>[a-z]<br></td>
1044+
<td>In the search expression it matches any lower case letter. In the
1045+
replace expression it lowercases the character or character representer following it.<br>
10481046
</td>
10491047
</tr>
10501048
<tr>
1051-
<td valign="top">\L<br>
1052-
</td>
1053-
<td valign="top">[^a-z]<br>
1054-
</td>
1055-
<td valign="top">In the search expression \L matches any character except except a lowercase letter.
1056-
In the replace expression it makes everything that follows it, to the end
1057-
of the replace expression, lower case. However, a later \U in the replace
1058-
expression ends its effect.<br>
1059-
</td>
1049+
<td>\L<br></td>
1050+
<td>[^a-z]<br></td>
1051+
<td>In the search expression \L matches any character except except a lowercase letter.
1052+
In the replace expression it makes everything that follows it, to the end of the replace expression, lower case. However, a later \U in the replace expression ends its effect.<br> </td>
10601053
</tr>
10611054
<tr>
1062-
<td valign="top">\u<br>
1063-
</td>
1064-
<td valign="top">[A-Z]<br>
1065-
</td>
1066-
<td valign="top">Uppercase
1067-
letter. In the search expression it matches any lower case letter. In the
1068-
replace expression it capitalizes the character following it. </td>
1055+
<td>\u<br></td>
1056+
<td>[A-Z]<br></td>
1057+
<td>In the search expression it matches any lower case letter. In the
1058+
replace expression it capitalizes the character following it.</td>
10691059
</tr>
10701060
<tr>
1071-
<td valign="top">\U<br>
1072-
</td>
1073-
<td valign="top">[^A-Z]<br>
1074-
</td>
1075-
<td valign="top">In the search expression \U matches any character except except an uppercase letter.
1076-
In the replace expression it makes everything that follows it, to the end
1077-
of the replace expression, upper case. However, a later \L in the replace
1078-
expression ends its effect.
1079-
</td>
1061+
<td>\U<br></td>
1062+
<td>[^A-Z]<br></td>
1063+
<td>In the search expression \U matches any character except except an uppercase letter. In the replace expression it makes everything that follows it, to the end of the replace expression, upper case. However, a later \L in the replace expression ends its effect.</td>
10801064
</tr>
10811065

10821066
</tbody>
@@ -1147,83 +1131,83 @@ <h2 style="border-bottom:1px solid lightgray"><a id="ex-Commands">ex Commands</a
11471131
<p>ex命令采用以下格式:</p>
11481132
<p><code>:[address]command[options]</code></p>
11491133

1150-
<h3>寻址符号 Address Symbols</h3>
1134+
<h3>寻址符号 Address Symbols / Range</h3>
11511135
<table border="0">
11521136
<tbody>
11531137
<tr>
1154-
<td valign="top"><code>1,$</code></td>
1138+
<td><code>x,y</code></td>
11551139
<td>&nbsp;</td>
1156-
<td valign="top"> 所有行 All lines in the file</td>
1140+
<td><em>x</em><em>y</em>的所有行 separates two lines numbers</td>
11571141
</tr>
11581142
<tr>
1159-
<td valign="top"><code>x,y</code></td>
1143+
<td><code>0</code></td>
11601144
<td>&nbsp;</td>
1161-
<td valign="top"><em>x</em><em>y</em>的所有行</td>
1145+
<td>文件开头 Top of the file</td>
11621146
</tr>
11631147
<tr>
1164-
<td valign="top"><code>0</code></td>
1148+
<td><code>.</code></td>
11651149
<td>&nbsp;</td>
1166-
<td valign="top">文件开头 Top of the file</td>
1150+
<td>当前行 Current line</td>
11671151
</tr>
11681152
<tr>
1169-
<td valign="top"><code>.</code></td>
1153+
<td><code>n</code></td>
11701154
<td>&nbsp;</td>
1171-
<td valign="top">当前行 Current line</td>
1155+
<td>绝对<a href="http://yyq123.github.io/learn-vim/learn-vi-32-LineNumber.html" title="">行号</a>Absolute line number<em>n</em></td>
11721156
</tr>
11731157
<tr>
1174-
<td valign="top"><code>n</code></td>
1158+
<td><code>$</code></td>
11751159
<td>&nbsp;</td>
1176-
<td valign="top">绝对<a href="http://yyq123.github.io/learn-vim/learn-vi-32-LineNumber.html" title="">行号</a>Absolute line number<em>n</em></td>
1160+
<td>最后一行 Last line</td>
11771161
</tr>
11781162
<tr>
1179-
<td valign="top"><code>$</code></td>
1163+
<td><code>%</code></td>
11801164
<td>&nbsp;</td>
1181-
<td valign="top">最后一行 Last line</td>
1165+
<td>所有行 All lines; same as <code>1,$</code></td>
11821166
</tr>
11831167
<tr>
1184-
<td valign="top"><code>%</code></td>
1168+
<td><code>*</code></td>
11851169
<td>&nbsp;</td>
1186-
<td valign="top">所有行 All lines; same as <code>1,$</code></td>
1170+
<td>选中的区域 Visual area; same as <code>'&lt;,'&gt;</code></td>
11871171
</tr>
11881172
<tr>
1189-
<td valign="top"><code>x-n</code></td>
1173+
<td><code>x-n</code></td>
11901174
<td>&nbsp;</td>
1191-
<td valign="top"><em>n</em> lines before <em>x</em></td>
1175+
<td><em>n</em> lines before <em>x</em></td>
11921176
</tr>
11931177
<tr>
1194-
<td valign="top"><code>x+n</code></td>
1178+
<td><code>x+n</code></td>
11951179
<td>&nbsp;</td>
1196-
<td valign="top"><em>n</em> lines after <em>x</em></td>
1180+
<td><em>n</em> lines after <em>x</em></td>
11971181
</tr>
11981182
<tr>
1199-
<td valign="top"><code>-[n]</code></td>
1183+
<td><code>-[n]</code></td>
12001184
<td>&nbsp;</td>
1201-
<td valign="top">One or <em>n</em> lines previous</td>
1185+
<td>One or <em>n</em> lines previous</td>
12021186
</tr>
12031187
<tr>
1204-
<td valign="top"><code>+[n]</code></td>
1188+
<td><code>+[n]</code></td>
12051189
<td>&nbsp;</td>
1206-
<td valign="top">One or <em>n</em> lines ahead</td>
1190+
<td>One or <em>n</em> lines ahead</td>
12071191
</tr>
12081192
<tr>
1209-
<td valign="top"><code>'x</code></td>
1193+
<td><code>'x</code></td>
12101194
<td>&nbsp;</td>
1211-
<td valign="top"><a href="http://yyq123.github.io/learn-vim/learn-vi-53-Mark.html" title="">标记</a><em>x</em></td>
1195+
<td><a href="http://yyq123.github.io/learn-vim/learn-vi-53-Mark.html" title="">标记</a> position of mark<em>x</em></td>
12121196
</tr>
12131197
<tr>
1214-
<td valign="top"><code>''</code></td>
1198+
<td><code>''</code></td>
12151199
<td>&nbsp;</td>
1216-
<td valign="top">上一<a href="http://yyq123.github.io/learn-vim/learn-vi-53-Mark.html" title="">标记</a> Previous mark</td>
1200+
<td>上一<a href="http://yyq123.github.io/learn-vim/learn-vi-53-Mark.html" title="">标记</a> Previous mark</td>
12171201
</tr>
12181202
<tr>
1219-
<td valign="top"><code>/pattern/</code></td>
1203+
<td><code>/pattern/</code></td>
12201204
<td>&nbsp;</td>
1221-
<td valign="top">向前匹配模式<em>pattern</em></td>
1205+
<td>向前匹配模式 the next line where <em>pattern</em> matches</td>
12221206
</tr>
12231207
<tr>
1224-
<td valign="top"><code>?pattern?</code></td>
1208+
<td><code>?pattern?</code></td>
12251209
<td>&nbsp;</td>
1226-
<td valign="top">向后匹配模式<em>pattern</em></td>
1210+
<td>向后匹配模式 the previous line where <em>pattern</em> matches</td>
12271211
</tr>
12281212
</tbody></table>
12291213

@@ -1240,17 +1224,30 @@ <h2><em>Command Option Symbols</em></h2>
12401224
<td>&nbsp;</td>
12411225
<td>A variant form of the command</td>
12421226
</tr>
1227+
<tr>
1228+
<td><code>"</code></td>
1229+
<td>&nbsp;</td>
1230+
<td>注释</td>
1231+
</tr>
12431232
<tr>
12441233
<td><code>count</code></td>
12451234
<td>&nbsp;</td>
12461235
<td>Repeat the command <em>count</em> times</td>
12471236
</tr>
12481237
<tr>
1249-
<td><code>file</code></td>
1238+
<td><code>|</code></td>
1239+
<td>&nbsp;</td>
1240+
<td>分割两个命令 separates two command</td>
1241+
</tr>
1242+
<tr>
1243+
<td><code>%</code></td>
1244+
<td>&nbsp;</td>
1245+
<td>current filename</td>
1246+
</tr>
1247+
<tr>
1248+
<td><code>#</code></td>
12501249
<td>&nbsp;</td>
1251-
<td>Filename: <code>%</code> is
1252-
current file, <code>#</code>
1253-
is previous file</td>
1250+
<td>alternate filename</td>
12541251
</tr>
12551252
</tbody></table>
12561253

learn-vim-Appendix-KeyMapping.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,6 +1940,7 @@ <h3>
19401940
<tr><th>Key</th><th>Action</th></tr>
19411941
</thead>
19421942
<tbody>
1943+
<tr><td><kbd>&lt;Tab&gt;</kbd></td><td>启动通配符扩展 'wildchar' do completion on the pattern in front of the cursor</td></tr>
19431944
<tr><td><kbd>&lt;Left&gt;</kbd></td><td>向左移动</td></tr>
19441945
<tr><td><kbd>&lt;Right&gt;</kbd></td><td>向有移动</td></tr>
19451946
<tr><td><kbd>&lt;S-Left&gt;</kbd></td><td>向左移动一个词 cursor one word left</td></tr>
@@ -1957,8 +1958,11 @@ <h3>
19571958
<tr><td><kbd>&lt;S-Down&gt;</kbd></td><td></td></tr>
19581959
<tr><td><kbd>&lt;&gt;</kbd></td><td></td></tr>
19591960
<tr><td><kbd>&lt;&gt;</kbd></td><td></td></tr>
1960-
<tr><td><kbd></kbd></td><td></td></tr>
1961-
<tr><td><kbd></kbd></td><td></td></tr>
1961+
<tr><td><kbd>CTRL-D</kbd></td><td>列出与光标前面的模式所匹配的名字 list all names that match the pattern in front of the cursor</td></tr>
1962+
<tr><td><kbd>CTRL-N</kbd></td><td>选择下一项匹配 go to next match</td></tr>
1963+
<tr><td><kbd>CTRL-P</kbd></td><td>选择前一项匹配 go to previous match</td></tr>
1964+
<tr><td><kbd>CTRL-A</kbd></td><td>将所有与模式匹配的项全部插入到光标前面 insert all names that match pattern in front of cursor</td></tr>
1965+
<tr><td><kbd>CTRL-L</kbd></td><td>取项目中尽可能长的共同部分插入 insert longest common part of names that match pattern</td></tr>
19621966
<tr><td><kbd></kbd></td><td></td></tr>
19631967
<tr><td><kbd></kbd></td><td></td></tr>
19641968
</tbody>

0 commit comments

Comments
 (0)