annotate runtime/tutor/tutor.zh.big5 @ 9532:93eab84751b7

Added tag v7.4.2046 for changeset 50697f3b49d62b3907ccdf5b30a1f6df9e829e8a
author Christian Brabandt <cb@256bit.org>
date Fri, 15 Jul 2016 22:45:06 +0200
parents 1e8ebf870720
children 723487cd7876
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 ===============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 = 歡 迎 閱 讀 《 V I M 教 程 》 ── 版本 1.5 =
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 ===============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 vim 是一個具有很多命令的功能非常強大的編輯器。限于篇幅,在本教程當中
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 不就詳細介紹了。本教程的設計目標是講述一些必要的基本命令,而掌握好這
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 些命令,您就能夠很容易將vim當作一個通用的萬能編輯器來使用了。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 完成本教程的內容大約需要25-30分鐘,取決于您訓練的時間。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 每一節的命令操作將會更改本文。推薦您復制本文的一個副本,然後在副本上
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 進行訓練(如果您是通過"vimtutor"來啟動教程的,那麼本文就已經是副本了)。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 切記一點︰本教程的設計思路是在使用中進行學習的。也就是說,您需要通過
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 執行命令來學習它們本身的正確用法。如果您只是閱讀而不操作,那麼您可能
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 會很快遺忘這些命令的!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 好了,現在請確定您的Shift-Lock(大小寫鎖定鍵)還沒有按下,然後按鍵盤上
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 的字母鍵 j 足夠多的次數來移動光標,直到第一節的內容能夠完全充滿屏幕。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 第一講第一節︰移動光標
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 ※※ 要移動光標,請依照說明分別按下 h、j、k、l 鍵。 ※※
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 ^
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 k 提示︰ h 的鍵位于左邊,每次按下就會向左移動。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 < h l > l 的鍵位于右邊,每次按下就會向右移動。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 j j 鍵看起來很象一支尖端方向朝下的箭頭。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 v
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 1. 請隨意在屏幕內移動光標,直至您覺得舒服為止。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 2. 按下下行鍵(j),直到出現光標重復下行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 ---> 現在您應該已經學會如何移動到下一講吧。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 3. 現在請使用下行鍵,將光標移動到第二講。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 提示︰如果您不敢確定您所按下的字母,請按下<ESC>鍵回到正常(Normal)模式。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 然後再次從鍵盤輸入您想要的命令。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 提示︰光標鍵應當也能正常工作的。但是使用hjkl鍵,在習慣之後您就能夠快速
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 地在屏幕內四處移動光標了。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 第一講第二節︰VIM的進入和退出
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 !! 特別提示︰敬請閱讀完整本一節的內容,然後才能執行以下所講解的命令。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 1. 請按<ESC>鍵(這是為了確保您處在正常模式)。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 2. 然後輸入︰ :q! <回車>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 ---> 這種方式的退出編輯器絕不會保存您進入編輯器以來所做的改動。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 如果您想保存更改再退出,請輸入︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 :wq <回車>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 3. 如果您看到了命令行提示符,請輸入能夠帶您回到本教程的命令,那就是︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 vimtutor <回車>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 通常情況下您也可以用這種方式︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 vim tutor <回車>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 ---> 這裡的 'vim' 表示進入vim編輯器,而 'tutor'則是您準備要編輯的文件。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 4. 如果您自信已經牢牢記住了這些步驟的話,請從步驟1執行到步驟3退出,然
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 後再次進入編輯器。接著將光標移動到第一講第三節來繼續我們的教程講解。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 第一講第三節︰文本編輯之刪除
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 ** 在正常(Normal)模式下,可以按下 x 鍵來刪除光標所在位置的字符。**
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 1. 請將光標移動到本節中下面標記有 ---> 的那一行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 2. 為了修正輸入錯誤,請將光標移至準備刪除的字符的位置處。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 3. 然後按下 x 鍵將錯誤字符刪除掉。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 4. 重復步驟2到步驟4,直到句子修正為止。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 ---> The ccow jumpedd ovverr thhe mooon.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 5. 好了,該行已經修正了,下一節內容是第一講第四節。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 特別提示︰在您瀏覽本教程時,不要強行記憶。記住一點︰在使用中學習。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 第一講第四節︰文本編輯之插入
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 ** 在正常模式下,可以按下 i 鍵來插入文本。**
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 1. 請將光標移動到本節中下面標記有 ---> 的第一行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 2. 為了使得第一行內容雷同于第二行,請將光標移至文本第一個字符準備插入
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 的位置。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 3. 然後按下 i 鍵,接著輸入必要的文本字符。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 4. 所有文本都修正完畢,請按下 <ESC> 鍵返回正常模式。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 重復步驟2至步驟4以便修正句子。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 ---> There is text misng this .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 ---> There is some text missing from this line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 5. 如果您對文本插入操作已經很滿意,請接著閱讀下面的小結。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 第一講小結
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 1. 光標在屏幕文本中的移動既可以用箭頭鍵,也可以使用 hjkl 字母鍵。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 h (左移) j (下行) k (上行) l (右移)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 2. 欲進入vim編輯器(從命令行提示符),請輸入︰vim 文件名 <回車>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 3. 欲退出vim編輯器,請輸入以下命令放棄所有修改︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 <ESC> :q! <回車>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 或者輸入以下命令保存所有修改︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 <ESC> :wq <回車>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 4. 在正常模式下刪除光標所在位置的字符,請按︰ x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 5. 在正常模式下要在光標所在位置開始插入文本,請按︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 i 輸入必要文本 <ESC>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 特別提示︰按下 <ESC> 鍵會帶您回到正常模式或者取消一個不期望或者部分完成
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 的命令。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 好了,第一講到此結束。下面接下來繼續第二講的內容。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 第二講第一節︰刪除類命令
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 ** 輸入 dw 可以從光標處刪除至一個單字/單詞的末尾。**
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 1. 請按下 <ESC> 鍵確保您處于正常模式。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 2. 請將光標移動到本節中下面標記有 ---> 的那一行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 3. 請將光標移至準備要刪除的單詞的開始。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 4. 接著輸入 dw 刪除掉該單詞。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 特別提示︰您所輸入的 dw 會在您輸入的同時出現在屏幕的最後一行。如果您輸
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 入有誤,請按下 <ESC> 鍵取消,然後重新再來。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 ---> There are a some words fun that don't belong paper in this sentence.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 5. 重復步驟3至步驟4,直至句子修正完畢。接著繼續第二講第二節內容。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 第二講第二節︰其他刪除類命令
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 ** 輸入 d$ 從當前光標刪除到行末。**
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 1. 請按下 <ESC> 鍵確保您處于正常模式。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 2. 請將光標移動到本節中下面標記有 ---> 的那一行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 3. 請將光標移動到該行的尾部(也就是在第一個點號‘.’後面)。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 4. 然後輸入 d$ 從光標處刪至當前行尾部。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 ---> Somebody typed the end of this line twice. end of this line twice.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 5. 請繼續學習第二講第三節就知道是怎麼回事了。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 第二講第三節︰關于命令和對象
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 刪除命令 d 的格式如下︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 [number] d object 或者 d [number] object
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 其意如下︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 number - 代表執行命令的次數(可選項,缺省設置為 1 )。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 d - 代表刪除。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 object - 代表命令所要操作的對象(下面有相關介紹)。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 一個簡短的對象列表︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 w - 從當前光標當前位置直到單字/單詞末尾,包括空格。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 e - 從當前光標當前位置直到單字/單詞末尾,但是 *不* 包括空格。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 $ - 從當前光標當前位置直到當前行末。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 特別提示︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 對于勇于探索者,請在正常模式下面僅按代表相應對象的鍵而不使用命令,則
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 將看到光標的移動正如上面的對象列表所代表的一樣。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 第二講第四節︰對象命令的特殊情況
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 ** 輸入 dd 可以刪除整一個當前行。 **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 鑒于整行刪除的高頻度,VIM 的設計者決定要簡化整行刪除,僅需要在同一行上
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 擊打兩次 d 就可以刪除掉光標所在的整行了。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 1. 請將光標移動到本節中下面的短句段落中的第二行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 2. 輸入 dd 刪除該行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 3. 然後移動到第四行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 4. 接著輸入 2dd (還記得前面講過的 number-command-object 嗎?) 刪除兩行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 1) Roses are red,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 2) Mud is fun,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 3) Violets are blue,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 4) I have a car,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 5) Clocks tell time,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 6) Sugar is sweet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 7) And so are you.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 第二講第五節︰撤消類命令
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 ** 輸入 u 來撤消最後執行的命令,輸入 U 來修正整行。**
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 1. 請將光標移動到本節中下面標記有 ---> 的那一行,並將其置于第一個錯誤
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 處。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 2. 輸入 x 刪除第一個不想保留的字母。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 3. 然後輸入 u 撤消最後執行的(一次)命令。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 4. 這次要使用 x 修正本行的所有錯誤。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 5. 現在輸入一個大寫的 U ,恢復到該行的原始狀態。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 6. 接著多次輸入 u 以撤消 U 以及更前的命令。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 7. 然後多次輸入 CTRL-R (先按下 CTRL 鍵不放開,接著輸入 R 鍵) ,這樣就
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 可以執行恢復命令,也就是撤消掉撤消命令。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257 ---> Fiix the errors oon thhis line and reeplace them witth undo.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 8. 這些都是非常有用的命令。下面是第二講的小結了。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 第二講小結
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 1. 欲從當前光標刪除至單字/單詞末尾,請輸入︰dw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 2. 欲從當前光標刪除至當前行末尾,請輸入︰d$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 3. 欲刪除整行,請輸入︰dd
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 4. 在正常模式下一個命令的格式是︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 [number] command object 或者 command [number] object
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 其意是︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 number - 代表的是命令執行的次數
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 command - 代表要做的事情,比如 d 代表刪除
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 object - 代表要操作的對象,比如 w 代表單字/單詞,$ 代表到行末等等。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 $ (to the end of line), etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 5. 欲撤消以前的操作,請輸入︰u (小寫的u)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 欲撤消在一行中所做的改動,請輸入︰U (大寫的U)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 欲撤消以前的撤消命令,恢復以前的操作結果,請輸入︰CTRL-R
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 第三講第一節︰置入類命令
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 ** 輸入 p 將最後一次刪除的內容置入光標之後 **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 1. 請將光標移動到本節中下面示范段落的首行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 2. 輸入 dd 將該行刪除,這樣會將該行保存到vim的緩沖區中。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297 3. 接著將光標移動到準備置入的位置的上方。記住︰是上方哦。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 4. 然後在正常模式下(<ESC>鍵進入),輸入 p 將該行粘貼置入。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301 5. 重復步驟2至步驟4,將所有的行依序放置到正確的位置上。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 d) Can you learn too?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 b) Violets are blue,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 c) Intelligence is learned,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 a) Roses are red,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311 第三講第二節︰替換類命令
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314 ** 輸入 r 和一個字符替換光標所在位置的字符。**
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316 1. 請將光標移動到本節中下面標記有 ---> 的第一行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 2. 請移動光標到第一個錯誤的適當位置。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 3. 接著輸入 r ,這樣就能將錯誤替換掉了。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 4. 重復步驟2和步驟3,直到第一行已經修改完畢。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324 ---> Whan this lime was tuoed in, someone presswd some wrojg keys!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 ---> When this line was typed in, someone pressed some wrong keys!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327 5. 然後我們繼續學校第三講第三節。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329 特別提示︰切記您要在使用中學習,而不是在記憶中學習。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334 第三講第三節︰更改類命令
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 ** 要改變一個單字/單詞的部分或者全部,請輸入 cw **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339 1. 請將光標移動到本節中下面標記有 ---> 的第一行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 2. 接著把光標放在單詞 lubw 的字母 u 的位置那裡。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 3. 然後輸入 cw 就可以修正該單詞了(在本例這裡是輸入 ine 。)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 4. 最後按 <ESC> 鍵,然後光標定位到下一個錯誤第一個準備更改的字母處。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 5. 重復步驟3和步驟4,直到第一個句子完全雷同第二個句子。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 ---> This lubw has a few wptfd that mrrf changing usf the change command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 ---> This line has a few words that need changing using the change command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 提示︰請注意 cw 命令不僅僅是替換了一個單詞,也讓您進入文本插入狀態了。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 第三講第四節︰使用c指令的其他更改類命令
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 ** 更改類指令可以使用同刪除類命令所使用的對象參數。**
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 1. 更改類指令的工作方式跟刪除類命令是一致的。操作格式是︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 [number] c object 或者 c [number] object
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366 2. 對象參數也是一樣的,比如 w 代表單字/單詞,$代表行末等等。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 3. 請將光標移動到本節中下面標記有 ---> 的第一行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 4. 接著將光標移動到第一個錯誤處。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 5. 然後輸入 c$ 使得該行剩下的部分更正得同第二行一樣。最後按 <ESC> 鍵。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374 ---> The end of this line needs some help to make it like the second.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 ---> The end of this line needs to be corrected using the c$ command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 第三講小結
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 1. 要重新置入已經刪除的文本內容,請輸入小寫字母 p。該操作可以將已刪除
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 的文本內容置于光標之後。如果最後一次刪除的是一個整行,那麼該行將置
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 于當前光標所在行的下一行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387 2. 要替換光標所在位置的字符,請輸入小寫的 r 和要替換掉原位置字符的新字
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 符即可。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 3. 更改類命令允許您改變指定的對象,從當前光標所在位置直到對象的末尾。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 比如輸入 cw 可以替換當前光標到單詞的末尾的內容;輸入 c$ 可以替換當
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392 前光標到行末的內容。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 4. 更改類命令的格式是︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396 [number] c object 或者 c [number] object
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398 下面我們繼續學習下一講。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 第四講第一節︰定位及文件狀態
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 ** 輸入 CTRL-g 顯示當前編輯文件中當前光標所在行位置以及文件狀態信息。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407 輸入 SHIFT-G 則直接跳轉到文件中的某一指定行。**
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 提示︰切記要先通讀本節內容,之後才可以執行以下步驟!!!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 1. 按下 CTRL 鍵不放開然後按 g 鍵。然後就會看到頁面最底部出現一個狀態信
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 息行,顯示的內容是當前編輯的文件名和文件的總行數。請記住步驟3的行號。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414 2. 按下 SHIFT-G 鍵可以使得當前光標直接跳轉到文件最後一行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 3. 輸入您曾停留的行號,然後按下 SHIFT-G。這樣就可以返回到您第一次按下
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417 CTRL-g 時所在的行好了。注意︰輸入行號時,行號是不會在屏幕上顯示出來
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 的。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 4. 如果願意,您可以繼續執行步驟1至步驟三。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 第四講第二節︰搜索類命令
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 ** 輸入 / 以及尾隨的字符串可以用以在當前文件中查找該字符串。**
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430 1. 在正常模式下輸入 / 字符。您此時會注意到該字符和光標都會出現在屏幕底
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 部,這跟 : 命令是一樣的。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 2. 接著輸入 errroor <回車>。那個errroor就是您要查找的字符串。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 3. 要查找同上一次的字符串,只需要按 n 鍵。要向相反方向查找同上一次的字
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 符串,請輸入 Shift-N 即可。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 4. 如果您想逆向查找字符串,請使用 ? 代替 / 進行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 ---> When the search reaches the end of the file it will continue at the start.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442 "errroor" is not the way to spell error; errroor is an error.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444 提示︰如果查找已經到達文件末尾,查找會自動從文件頭部繼續查找。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 第四講第三節︰配對括號的查找
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452 ** 按 % 可以查找配對的括號 )、]、}。**
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454 1. 把光標放在本節下面標記有 --> 那一行中的任何一個 (、[ 或 { 處。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
456 2. 接著按 % 字符。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458 3. 此時光標的位置應當是在配對的括號處。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
460 4. 再次按 % 就可以跳回配對的第一個括號處。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462 ---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464 提示︰在程序調試時,這個功能用來查找不配對的括號是很有用的。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
466
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472 第四講第四節︰修正錯誤的方法之一
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475 ** 輸入 :s/old/new/g 可以替換 old 為 new。**
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 1. 請將光標移動到本節中下面標記有 ---> 的那一行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
479 2. 輸入 :s/thee/the <回車> 。請注意該命令只改變光標所在行的第一個匹配
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480 串。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482 3. 輸入 :s/thee/the/g 則是替換全行的匹配串。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
483
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484 ---> the best time to see thee flowers is in thee spring.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
486 4. 要替換兩行之間出現的每個匹配串,請輸入 :#,#s/old/new/g (#,#代表的是
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487 兩行的行號)。輸入 :%s/old/new/g 則是替換整個文件中的每個匹配串。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
488
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
489
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
491
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
492 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
493 第四講小結
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
494
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
495
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496 1. Ctrl-g 用于顯示當前光標所在位置和文件狀態信息。Shift-G 用于將光標跳
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
497 轉至文件最後一行。先敲入一個行號然後按 Shift-G 則是將光標移動至該行
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
498 號代表的行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
499
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
500 2. 輸入 / 然後緊隨一個字符串是則是在當前所編輯的文檔中向後查找該字符串。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
501 輸入問號 ? 然後緊隨一個字符串是則是在當前所編輯的文檔中向前查找該字
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 符串。完成一次查找之後按 n 鍵則是重復上一次的命令,可在同一方向上查
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
503 找下一個字符串所在;或者按 Shift-N 向相反方向查找下該字符串所在。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 3. 如果光標當前位置是括號(、)、[、]、{、},按 % 可以將光標移動到配對的
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506 括號上。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
507
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508 4. 在一行內替換頭一個字符串 old 為新的字符串 new,請輸入 :s/old/new
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
509 在一行內替換所有的字符串 old 為新的字符串 new,請輸入 :s/old/new/g
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510 在兩行內替換所有的字符串 old 為新的字符串 new,請輸入 :#,#s/old/new/g
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
511 在文件內替換所有的字符串 old 為新的字符串 new,請輸入 :%s/old/new/g
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
512 進行全文替換時詢問用戶確認每個替換需添加 c 選項,請輸入 :%s/old/new/gc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
513
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
514
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
515 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
516 第五講第一節︰在 VIM 內執行外部命令的方法
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
518
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
519 ** 輸入 :! 然後緊隨著輸入一個外部命令可以執行該外部命令。**
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
520
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521 1. 按下我們所熟悉的 : 命令設置光標到屏幕底部。這樣就可以讓您輸入命令了。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
522
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523 2. 接著輸入感嘆號 ! 這個字符,這樣就允許您執行外部的 shell 命令了。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525 3. 我們以 ls 命令為例。輸入 !ls <回車> 。該命令就會列舉出您當前目錄的
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526 內容,就如同您在命令行提示符下輸入 ls 命令的結果一樣。如果 !ls 沒起
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527 作用,您可以試試 :!dir 看看。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
529 ---> 提示︰ 所有的外部命令都可以以這種方式執行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
530
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
531 ---> 提示︰ 所有的 : 命令都必須以 <回車> 告終。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
532
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
533
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
534
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
535
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
536 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
537 第五講第二節︰關于保存文件的更多信息
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
538
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
539
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
540 ** 要將對文件的改動保存到文件中,請輸入 :w FILENAME **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
541
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
542 1. 輸入 :!dir 或者 :!ls 獲知當前目錄的內容。您應當已知道最後還得敲
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
543 <回車> 吧。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
544
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
545 2. 選擇一個尚未存在文件名,比如 TEST 。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
546
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
547 3. 接著輸入 :w TEST (此處 TEST 是您所選擇的文件名。)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
548
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
549 4. 該命令會以 TEST 為文件名保存整個文件 (VIM 教程)。為了確保正確保存,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
550 請再次輸入 :!dir 查看您的目錄列表內容。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
551
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
552 ---> 請注意︰如果您退出 VIM 然後在以文件名 TEST 為參數進入,那麼該文件內
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
553 容應該同您保存時的文件內容是完全一樣的。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
554
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
555 5. 現在您可以通過輸入 :!rm TEST 來刪除 TEST 文件了。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
556
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
557
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
558
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
559 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
560 第五講第三節︰一個具有選擇性的保存命令
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
561
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
562
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
563 ** 要保存文件的部分內容,請輸入 :#,# w FILENAME **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
564
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
565 1. 再來執行一次 :!dir 或者 :!ls 獲知當前目錄的內容,然後選擇一個合適的
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
566 不重名的文件名,比如 TEST 。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
567
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
568 2. 接著將光標移動至本頁的最頂端,然後按 CTRL-g 找到該行的行號。別忘了
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
569 行號哦。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
570
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
571 3. 接著把光標移動至本頁的最底端,再按一次 CTRL-g 。也別忘了這個行好哦。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
572
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
573 4. 為了只保存文章的某個部分,請輸入 :#,# w TEST 。這裡的 #,# 就是上面
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
574 要求您記住的行號(頂端行號,底端行號),而 TEST 就是選定的文件名。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
575
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
576 5. 最後,用 :!dir 確認文件是否正確保存。但是這次先別刪除掉。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
577
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
578
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
579
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
580
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
581 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
582 第五講第四節︰提取和合並文件
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
583
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
584
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
585 ** 要向當前文件中插入另外的文件的內容,請輸入 :r FILENAME **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
586
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
587 1. 請鍵入 :!dir 確認您前面創建的 TEST 文件還在。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
588
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
589 2. 然後將光標移動至當前頁面的頂端。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
590
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
591 特別提示︰ 執行步驟3之後您將看到第五講第三節,請屆時再往下移動回到這裡來。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
592
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
593 3. 接著通過 :r TEST 將前面創建的名為 TEST 的文件提取進來。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
594
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
595 特別提示︰您所提取進來的文件將從光標所在位置處開始置入。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
596
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
597 4. 為了確認文件已經提取成功,移動光標回到原來的位置就可以注意有兩份第
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
598 五講第三節,一份是原本,另外一份是來自文件的副本。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
599
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
601
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
602 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
603 第五講小結
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
604
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
605
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
606 1. :!command 用于執行一個外部命令 command。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
607
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
608 請看一些實際例子︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
609 :!dir - 用于顯示當前目錄的內容。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
610 :!rm FILENAME - 用于刪除名為 FILENAME 的文件。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
611
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
612 2. :w FILENAME 可將當前 VIM 中正在編輯的文件保存到名為 FILENAME
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
613 的文件中。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
614
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
615 3. :#,#w FILENAME 可將當前編輯文件第 # 行至第 # 行的內容保存到文件
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
616 FILENAME 中。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
617
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
618 4. :r FILENAME 可提取磁盤文件 FILENAME 並將其插入到當前文件的光標位置
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
619 後面。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
620
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
621
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
622
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
623
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
624
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
625
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
626
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
627 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
628 第六講第一節︰打開類命令
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
629
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
630
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
631 ** 輸入 o 將在光標的下方打開新的一行並進入插入模式。**
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
632
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
633 1. 請將光標移動到本節中下面標記有 ---> 的那一行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
634
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
635 2. 接著輸入小寫的 o 在光標 *下方* 打開新的一行並進入插入模式。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
636
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
637 3. 然後復制標記有 ---> 的行並按 <ESC> 鍵退出插入模式而進入正常模式。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
638
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
639 ---> After typing o the cursor is placed on the open line in Insert mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
640
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
641 4. 為了在光標 *上方* 打開新的一行,只需要輸入大寫的 O 而不是小寫的 o
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
642 就可以了。請在下行測試一下吧。當光標處在在該行上時,按 Shift-O可以
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
643 在該行上方新開一行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
644
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
645 Open up a line above this by typing Shift-O while the cursor is on this line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
646
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
647
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
648
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
649
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
650
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
651 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
652 第六講第二節︰光標後插入類命令
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
653
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
654
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
655 ** 輸入 a 將可在光標之後插入文本。 **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
656
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
657 1. 請在正常模式下通過輸入 $ 將光標移動到本節中下面標記有 ---> 的第一行
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
658 的末尾。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
659
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
660 2. 接著輸入小寫的 a 則可在光標之後插入文本了。大寫的 A 則可以直接在行
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
661 末插入文本。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
662
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
663 提示︰輸入大寫 A 的操作方法可以在行末插入文本,避免了輸入 i,光標定位到
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
664 最後一個字符,輸入的文本,<ESC> 回復正常模式,箭頭右鍵移動光標以及
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
665 x 刪除當前光標所在位置字符等等諸多繁雜的操作。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
666
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
667 3. 操作之後第一行就可以補充完整了。請注意光標後插入文本與插入模式是基
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
668 本完全一致的,只是文本插入的位置定位稍有不同罷了。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
669
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
670 ---> This line will allow you to practice
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
671 ---> This line will allow you to practice appending text to the end of a line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
672
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
673
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
674
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
675 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
676 第六講第三節︰另外一個置換類命令的版本
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
677
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
678
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
679 ** 輸入大寫的 R 可連續替換多個字符。**
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
680
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
681 1. 請將光標移動到本節中下面標記有 ---> 的第一行。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
682
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
683 2. 移動光標到第一行中不同于標有 ---> 的第二行的第一個單詞的開始,即單
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
684 詞 last 處。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
685
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
686 3. 然後輸入大寫的 R 開始把第一行中的不同于第二行的剩余字符逐一輸入,就
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
687 可以全部替換掉原有的字符而使得第一行完全雷同第二行了。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
688
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
689 ---> To make the first line the same as the last on this page use the keys.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
690 ---> To make the first line the same as the second, type R and the new text.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
691
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
692 4. 請注意︰如果您按 <ESC> 退出置換模式回復正常模式,尚未替換的文本將仍
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
693 然保持原狀。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
694
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
695
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
696
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
697
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
698
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
699 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
700 第六講第四節︰設置類命令的選項
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
701
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
702
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
703 ** 設置可使查找或者替換可忽略大小寫的選項 **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
704
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
705
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
706 1. 要查找單詞 ignore 可在正常模式下輸入 /ignore 。要重復查找該詞,可以
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
707 重復按 n 鍵。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
708
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
709 2. 然後設置 ic 選項(ic就是英文忽略大小寫Ignore Case的首字母縮寫詞),即
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
710 輸入︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
711 :set ic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
712
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
713 3. 現在可以通過鍵入 n 鍵再次查找單詞 ignore。重復查找可以重復鍵入 n 鍵。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
714
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
715 4. 然後設置 hlsearch 和 incsearch 這兩個選項,輸入以下內容︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
716 :set hls is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
717
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
718 5. 現在可以再次輸入查找命令,看看會有什麼效果︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
719 /ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
720
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
721 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
722 第六講小結
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
723
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
724
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
725 1. 輸入小寫的 o 可以在光標下方打開新的一行並將光標置于新開的行首,進入
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
726 插入模式。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
727 輸入大寫的 O 可以在光標上方打開新的一行並將光標置于新開的行首,進入
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
728 插入模式。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
729
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
730 2. 輸入小寫的 a 可以在光標所在位置之後插入文本。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
731 輸入大寫的 A 可以在光標所在行的行末之後插入文本。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
732
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
733 3. 輸入大寫的 R 將進入替換模式,直至按 <ESC> 鍵退出替換模式而進入正常
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
734 模式。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
735
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
736 4. 輸入 :set xxx 可以設置 xxx 選項。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
737
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
738
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
739
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
740
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
741
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
742
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
743
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
744
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
745
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
746 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
747 第七講︰在線幫助命令
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
748
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
749 ** 使用在線幫助系統 **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
750
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
751 Vim 擁有一個細致全面的在線幫助系統。要啟動該幫助系統,請選擇如下三種方
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
752 法之一︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
753 - 按下 <HELP> 鍵 (如果鍵盤上有的話)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
754 - 按下 <F1> 鍵 (如果鍵盤上有的話)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
755 - 輸入 :help <回車>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
756
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
757 輸入 :q <回車> 可以關閉幫助窗口。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
758
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
759 提供一個正確的參數給":help"命令,您可以找到關于該主題的幫助。請試驗以
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
760 下參數(可別忘了按回車鍵哦。:)︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
761
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
762 :help w <回車>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
763 :help c_<T <回車>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
764 :help insert-index <回車>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
765 :help user-manual <回車>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
766
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
767
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
769
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
770 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
771 第八講︰創建一個啟動腳本
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
772
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
773 ** 啟用vim的功能 **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
774
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
775 Vim的功能特性要比vi多得多,但大部分功能都沒有缺省激活。為了啟動更多的
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
776 功能,您得創建一個vimrc文件。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
777
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
778 1. 開始編輯vimrc文件,這取決于您所使用的操作系統︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
779
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
780 :edit ~/.vimrc 這是Unix系統所使用的命令
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
781 :edit $VIM/_vimrc 這是Windows系統所使用的命令
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
782
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
783 2. 接著導入vimrc范例文件︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
784
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
785 :read $VIMRUNTIME/vimrc_example.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
786
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
787 3. 保存文件,命令為︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
788
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
789 :write
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
790
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
791 在下次您啟動vim的時候,編輯器就會有了語法高亮的功能。您可以繼續把您喜
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
792 歡的其它功能設置添加到這個vimrc文件中。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
793
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
794 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
795
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
796 vim 教程到此結束。本教程只是為了簡明地介紹一下vim編輯器,但已足以讓您
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
797 很容易學會使用本編輯器了。毋庸質疑,vim還有很多很多的命令,本教程所介
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
798 紹的還差得遠著呢。所以您要精通的話,還望繼續努力哦。下一步您可以閱讀
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
799 vim手冊,使用的命令是︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
800 :help user-manual
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
801
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
802 為了更進一步的參考和學習,以下這本書值得推薦︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
803
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
804 Vim - Vi Improved - 作者︰Steve Oualline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
805 出版社︰New Riders
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
806
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
807 這是第一本完全講解vim的書籍。對于初學者特別有用。其中還包含有大量實例
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
808 和圖示。欲知詳情,請訪問 http://iccf-holland.org/click5.html
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
809
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
810 以下這本書比較老了而且內容主要是vi而不是vim,但是也值得推薦︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
811
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
812 Learning the Vi Editor - 作者︰Linda Lamb
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
813 出版社︰O'Reilly & Associates Inc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
814
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
815 這是一本不錯的書,通過它您幾乎能夠了解到全部vi能夠做到的事情。此書的第
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
816 六個版本也包含了一些關于vim的信息。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
817
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
818 本教程是由來自Calorado School of Minese的Michael C. Pierce、Robert K.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
819 Ware 所編寫的,其中來自Colorado State University的Charles Smith提供了
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
820 很多創意。編者通信地址是︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
821
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
822 bware@mines.colorado.edu
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
823
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
824 本教程已由Bram Moolenaar專為vim進行修訂。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
825
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
826
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
827
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
828 譯制者附言︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
829 ===========
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
830 簡體中文教程翻譯版之譯制者為梁昌泰 <beos@turbolinux.com.cn>,還有
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
831 另外一個聯系地址︰linuxrat@gnuchina.org。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
832
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
833 繁體中文教程是從簡體中文教程翻譯版使用 Debian GNU/Linux 中文項目小
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
834 組的于廣輝先生編寫的中文漢字轉碼器 autoconvert 轉換而成的,並對轉
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
835 換的結果做了一些細節的改動。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
836
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
837 變更記錄︰
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
838 =========
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
839 2002年08月30日 梁昌泰 <beos@turbolinux.com.cn>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
840 感謝 RMS@SMTH 的指正,將多處錯誤修正。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
841
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
842 2002年04月22日 梁昌泰 <linuxrat@gnuchina.org>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
843 感謝 xuandong@sh163.net 的指正,將兩處錯別字修正。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
844
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
845 2002年03月18日 梁昌泰 <linuxrat@gnuchina.org>
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
846 根據Bram Moolenaar先生在2002年03月16日的來信要求,將vimtutor1.4中譯
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
847 版升級到vimtutor1.5。
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
848
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
849 2001年11月15日 梁昌泰 <linuxrat@gnuchina.org>
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
850 將vimtutor1.4中譯版提交給Bram Moolenaar和Sven Guckes。
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
851
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
852 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~