一直喜歡powerline插件所帶來(lái)的vim和Terminal效果豪墅。今天上午不想寫專利,就抽出空閑黔寇,在自己的Ubuntu上安裝了powerline偶器。之間出現(xiàn)一些錯(cuò)誤,現(xiàn)在記錄下來(lái)缝裤,方便以后的人吧屏轰。
1.下載powerline
因?yàn)閁buntu16.0LTS自帶了Python3和Python2版本,但是powerline僅支持python2.x系列憋飞,因此霎苗,使用pip安裝,需要這樣寫:撒旦
pip2 install powerline-status
2.查看poweline的安裝地址
在Terminal中輸入
pip2 show powerline-status
得到的Location即為所在的地址搀崭。記走墩场猾编!一般來(lái)說(shuō),此處的地址應(yīng)該為/user/local/開(kāi)頭的地址升敲!如果接下來(lái)的過(guò)程出現(xiàn)錯(cuò)誤答倡,請(qǐng)重點(diǎn)檢查此項(xiàng)內(nèi)容!
3.注冊(cè)到Terminal中
復(fù)制下列文檔
. /Location/powerline/bindings/bash/powerline.sh
此處的Location是在第2部中你自己的安裝地址驴党!
4.注冊(cè)到VIM中
在Terminal中輸入以下代碼
vim .vimrc
系統(tǒng)會(huì)創(chuàng)建.vimrc文件瘪撇,打開(kāi).vimrc文件,輸入下列代碼
set rtp+=/Location/powerline/bindings/vim
" These lines setup the environment to show graphics and colors correctly.
set nocompatible
set t_Co=256
let g:minBufExplForceSyntaxEnable = 1
if ! has('gui_running')
set ttimeoutlen=10
augroup FastEscape
autocmd!
au InsertEnter * set timeoutlen=0
au InsertLeave * set timeoutlen=1000
augroup END
endif
set laststatus=2 " Always display the statusline in all windows
set guifont=Inconsolata\ for\ Powerline:h14
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)
仍然的港庄,Location是你在第2部得到的自己的安裝地址~倔既!