Ubuntu環境下,如何更改預設的editor

執行下面的指令就可以選擇了

$ sudo update-alternatives --config editor

會出現一個列表。選擇你預設要使用的編輯器就行了。

驗證一下,看看是不是你使用的編輯器。

$ editor

$ sensible-editor

另外也可以直接執行更改成你要的

例如:

使用 nano

$ sudo update-alternatives --set editor /bin/nano

使用vim.tiny

$ update-alternatives --set editor /usr/bin/vim.tiny

使用vim.basic

$ update-alternatives --set editor /usr/bin/vim.basic

參考文件

TODO

待研究下面這個指令

$ select-editor