本文及圖片轉載自:http://www.viemu.com/a_vi_vim...html
Use
i
to enter insert mode,cursor turns from a block into a vertical line,
and you can type in text.vim
經過 i
鍵進入 Insert 模式,光標會從塊狀變爲豎線,這時你就能夠輸入文字了。segmentfault
Use
Esc
to return to normal mode.編輯器
經過 Esc
鍵返回 Normal 模式。spa
Use
x
to delete the current character.code
經過小寫 x
鍵刪除光標當前所在的字符。orm
Use
A
to go insert text at the end of the line ( wherever you are in the line! ).htm
不管當前光標在什麼位置,經過 A
鍵在當前行末尾進行字符插入。圖片
u
to undo the last action - traditional vi has a single level,while vim supports unlimited undo (Ctrl-R
to redo ).get
經過小寫 u
鍵能夠撤銷回退上一次操做 - 老版本的 vi 只支持一級的編輯歷史(即:只能撤銷或者恢復上一次變化),而 vim 支持無限的撤銷操做。
Ctrl-R
能夠重作一次上一次變化。
注:可以記錄變化的次數隨編輯器的不一樣而不一樣,一般也是能夠配置的。
0
jumps directly to the beginning of the line,$
to the end,
and^
to the first non-blank.
0
鍵跳轉至當前行開始,$
鍵跳轉至當前行末尾,^
鍵跳轉至當前行第一個 非blank
字符的位置,G
鍵跳轉至文件最後一行。
注:所謂blank
字符就是空格,tab,換行,回車等。