Debian默認編輯器為nano了,但是小編不喜歡使用此編輯器了,而是喜歡使用vim編輯器了,下面小編來為各位介紹修改Debian默認nano編輯器為vim的步驟.
有些同學在debian系統下輸入VI或VIM的命令編輯文本,確發現按鍵盤的上下左右方向鍵,變成顯示ABCD字符了,退格鍵也失靈,恩,沒錯這是有些debian系統默認的編輯器并不是VIM而是nano的緣故,下面有幾個方法可以解決問題,There is only one alternative in link group editor:/usr/bin/vim.tiny Nothing to configure.
第一種方法運行如下命令:
update-alternatives --config editor
出現如下界面:
- There are 3 alternatives which provide `editor'.
- Selection Alternative
- -----------------------------------------------
- 1 /bin/ed
- + 2 /bin/nano
- * 3 /usr/bin/vim.tiny
- --Vevb.com
- Press enter to keep the default[*], or type selection number:
選擇3重啟一下就可以了.
第二種如果update-alternatives --config editor后出現:There is only one alternative in link group editor: /usr/bin/vim.tiny Nothing to configure.那么說明VIM是存在的,我們可以直接刪除nano編輯器,VIM就會自動變成默認編輯器了.
apt-get remove nano
第三種方法:
修改etc目錄下的bash.bashrc 或者 .bashrc文件,添加一行:
export EDITOR=vim
第四種萬能法:
如上方法都不行,可能是你的系統本身就沒裝VIM,安裝一個Vim就可以了.
nano /etc/apt/sources.list
刪除所有內容添加源為:
- deb http://ftp.debian.org/debian squeeze main contrib non-free
- deb http://security.debian.org squeeze/updates main contrib non-free
ctrl+o #保存配置
ctrl+x #退出
apt-get update #更新源
apt-get upgrade #更新系統
重新安裝VIM編輯器:apt-get install vim
OK基本這樣操作VIM就可以用了,如果安裝了VIM還不行,那就從第一種或第二種方法,重新指定一下就可以了.
新聞熱點
疑難解答