修改 Debian/Ubuntu 預設 editor

Published on:

前幾天突然想到一個問題....由於 Ubuntu 預設 editor 是 nano,這對於一個 vim user 來說實在是不太舒服啊XD 所以稍微找了一下,找到一個很簡便的作法,可以用來修改預設 editor,方式如下:

$ sudo update-alternatives --config editor
[sudo] password for crboy: 
There are 4 choices for the alternative editor (providing /usr/bin/editor).

 Selection Path Priority Status
------------------------------------------------------------
* 0 /bin/nano 40 auto mode
 1 /bin/ed -100 manual mode
 2 /bin/nano 40 manual mode
 3 /usr/bin/vim.basic 30 manual mode
 4 /usr/bin/vim.tiny 10 manual mode

Press enter to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in manual mode.
$ 

其實重點就是那個 sudo update-alternatives --config editor 而已啦XD 後面照著指示操作就好了....:)

Comments

comments powered by Disqus