Vim Cmds
Mode Change
- 進入編輯模式:
i,a,o,R(取代) - 存檔:
:w+Enter - 存檔且離開:
:wq+Enter - 回到一般模式:
Esc
Function Keys
- 離開:
:q!+Enter - 回到當前行的最前/後:
0,$ - 移動 n 格/列:
數字+↑||↓||→||←||Enter(向下) ||Space(向右) - 移動到第幾行:
數字+g - 到首行:
[[ - 到末行:
]] - 上一頁/下一頁:
fn+↑||↓
Search and Replace
- 查找:
/(downward) ||?(upward) - 移動到下一個:
n,N - 預覽且取代:
/word+Enter+ciw(change inner word) +{內容}+Esc+ loop(n,.)
Delete
- del 跟 backspace:
x,X - 刪除 n 個字:
數字+x - 刪除整行:
dd - 刪除 n 行:
數字+dd
Copy & Paste
- 複製當行:
yy - 先
v移動,再y - 貼上:
p
Redo
- 復原前一動:
u - 重做上一動:
Ctrl+r - 重複上一動:
.