在所有的UNIX底下,預設的編輯器:vi(請用 \”vee-eye\”發音)。
為什麼要學,因為…
1.緊急模式底下,唯一的救難工具,Emacs、gedit、kedit等華麗的工具都無法使用。
2.考試會考(=.=)
我記下並操作Command mode、Edit mode與ex mode之間的切換。再記一下上下左右的移動,以前的鍵盤沒有方向鍵,h、j、k、l分別代別左、下、上、右。還有^可以到行首;$則是去行尾,尤其是^配合取代指令,在編輯一些設定檔等文件特別好用。
最後,練習並熟記搜尋與取代的指令,再去睡個回籠覺嚕!
2 Comments
Tasuka
Well, “ed” and “sed” also can save your life, some time it work fine then “vi”.
jute
Dear Tasuka,Thank you. By the way, “vi” is really powerful, but hard to learn.But I feel a little confused. Do you mean \”vi\” is not the only editor in emergencies??