linux中也有不少種編輯器,就像windows下的記事本、寫事本、word等均可以用來編輯文件,VIM編輯是是linux中最簡單的文本編輯器。vi 、viw用法同樣linux
![](http://static.javashuo.com/static/loading.gif)
工具/原料vim
方法/步驟windows
- 進入文件目錄,並打開文件b.txt
![](http://static.javashuo.com/static/loading.gif)
- 如今按鍵盤是沒法輸入內容的,按i鍵,進入編輯模式,狀態欄提示爲「插入」
![](http://static.javashuo.com/static/loading.gif)
- 輸入內容,如:hello vim
![](http://static.javashuo.com/static/loading.gif)
- 編輯完成後按ESC鍵退出編輯模式,狀態欄的插入已沒有。
![](http://static.javashuo.com/static/loading.gif)
- 按鍵盤 :再輸入wq,保存文件並退出。
![](http://static.javashuo.com/static/loading.gif)
- 再次打開文件,查看內容已經保存成功。
![](http://static.javashuo.com/static/loading.gif)
- 若是輸入內容後,輸入:q!,爲直接退出不保存內容。
![](http://static.javashuo.com/static/loading.gif)