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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容