Powerline – Adds Powerful Statuslines and Prompts to Vim Editor and Bash Terminal

原文地址:http://www.tecmint.com/powerline-adds-powerful-statuslines-and-prompts-to-vim-and-bash/

Step 1: Installing Generic Requirements for Powerline

# sudo apt-get install python-pip

Step 2: Installing Powerline Tool in Linux

#sudo apt-get install git
#sudo pip install git+git://github.com/Lokaltog/powerline

Step 3: Installing Powerline Fonts in Linux

#sudo wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
#sudo wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
#sudo mv PowerlineSymbols.otf /usr/share/fonts/
#sudo fc-cache -vf /usr/share/fonts/
#sudo mv 10-powerline-symbols.conf /etc/fonts/conf.d

Step 4: Setting Powerline for Bash Shell and Vim Statuslines

In this section we shall look at configuring Powerline for bash shell and vim editor. First make your terminal to support 256color by adding the following line to ~/.bashrc file as follows.

export TERM=screen-256color

Enable Powerline on Bash Shell

To enable Powerline in bash shell by default, you need to add the following snippet to your ~/.bashrc file.
First get the location of installed powerline using following command.
#sudo pip show powerline-status

Once you know the actual location of powerline, make sure to replace the location in the below line as per your system suggested.

powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1POWERLINE_BASH_SELECT=1
. /usr/local/lib/python2.7/dist-packages/powerline/bindings/bash/powerline.sh

Enable Powerline for Vim

If vim is your favorite editor, luckily there is a powerful plugin for vim, too. To enable this plugin, add these lines to ~/.vimrc file.

set  rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
set laststatus=2
set t_Co=256
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容