2017年2月10日 星期五

vim 套件安裝 - powerline 遇到的問題


powerline 算是 vim 的一個套件,可以讓介面看起來比較好看一些

我使用的環境是 ubnutu 16.04 LTS

安裝的方法很簡單

只需輸入 apt-get install 指令輸入帳戶密碼即可安裝


sudo apt-get install powerline 
安裝完後需要套用至 vim 的設定

方法為在 vim 設定檔 ~/.vimrc 中加入下列文字後重啟

set laststatus=2
set t_Co=256
python from powerline.vim import setup as powerline_setup
python powerline_setup()
python del powerline_setup

重啟後我使用 vim 都會出現此錯誤訊息(還是可編輯檔案)

Error detected while processing /x/x/.vimrc:
line    3:
E319: Sorry, the command is not available in this version: python from powerline.vim import setup as powerline_setup
line    4:
E319: Sorry, the command is not available in this version: python powerline_setup()
line    5:
E319: Sorry, the command is not available in this version: python del powerline_setup

我的解決方法為

apt-get install vim-nox-py2

即可成功使用此套件囉