顯示具有 vi 標籤的文章。 顯示所有文章
顯示具有 vi 標籤的文章。 顯示所有文章

2012年5月19日 星期六

解決Ubuntu上使用vi編輯時,方向鍵及倒退鍵(Backspace)操作失常的問題

Ubuntu上使用vi編輯器編輯時,有時會發現方向鍵和倒退鍵(Backspace)會失常。

如上圖

vi的輸入模式(inser mode)時:
1.輸入方向鍵會出現ABCD
2.倒退刪除鍵(Backspace)緅作用
此時,我們可以在家目錄底下,新增檔案「.vimrc」,在檔案中加入下列2行內容:
set nocompatible
set backspace=2
記得存檔後離開

接著再使用vi編輯器時便可正常使用方向鍵和倒退鍵(Backspace)了。

2012年3月16日 星期五

喔賣尬!原來這就是vi 的 h j k l (左下上右鍵) 的由來^______^"


I was reading about vim the other day and found out why it used hjkl keys as arrow keys. When Bill Joycreated the vi text editor he used the ADM-3A terminal, which had the arrows on hjkl keys. Naturally he reused the same keys and the rest is history!
Here is how the hjkl keys looked:

ADM-3A keyboard's hjkl keys with arrows.
And here is the whole terminal that vi was created on:

Lear Siegler's ADM-3A computer terminal.
Since vim is derived from vi, it uses the same hjkl keys.
And while we're at it, notice where the ESC key is positioned:

Lear Siegler's ADM-3A computer terminal's full keyboard.
That's why the ESC is used to change between vi modes! Because it's so close and easy to reach.
Also ever wondered why home directory is ~ in UNIX? Look at the HOME key in upper right corner!

HJKL T-Shirt!

I just got a deal with Teespring for a hjkl t-shirt! Teespring is like kickstarter for t-shirts. If at least 30 people commit to buy the shirt the deal goes through and everyone gets the shirt. Otherwise nothing happens.
Get your limited edition hjkl t-shirt now! (Ships worldwide in 4-8 days.)