Powerlineis a great statusline plugin for[Vim editor][1], which is developed inPythonand provides statuslines and prompts for many other applications such as bash, zsh, tmux and many more.
[
![Install Powerline Statuslines in Linux](http://www.tecmint.com/wp-content/uploads/2015/10/Install-Powerline-Statuslines-in-Linux-620x297.png)
][2]
Add Power to Linux Terminal with Powerline Tool
#### Features
1. It is written in Python, which makes it extensible and feature rich.
2. Stable and testable code base, which works well with Python 2.6+ and Python 3.
3. It also supports prompts and statuslines in several Linux utilities and tools.
4. It has configurations and decorator colors developed using JSON.
5. Fast and lightweight, with daemon support, which provides even more better performance.
#### Powerline Screenshots
[
![Powerline Vim Statuslines](http://www.tecmint.com/wp-content/uploads/2015/10/Powerline-Vim-Statuslines.png)
][3]
Powerline Vim Statuslines
In this article, I will show you how to installPowerlineandPowerline fontsand how to use withBashandVimunderRedHatandDebianbased systems.
### Step 1: Installing Generic Requirements for Powerline
Due to a naming conflict with some other unrelated projects, powerline program is available onPyPI(Python Package Index) under the package name aspowerline-status.
To install packages fromPyPI, we need a ‘pip‘ (package management tool for installing Python packages). So, let’s first installpiptool under our Linux systems.
#### Install Pip on Debian, Ubuntu and Linux Mint
```
# apt-get install python-pip
```
##### Sample Output
```
Reading package lists... Done
Building dependency tree
Reading state information... Done
Recommended packages:
python-dev-all python-wheel
The following NEW packages will be installed:
python-pip
0 upgraded, 1 newly installed, 0 to remove and 533 not upgraded.
Need to get 97.2 kB of archives.
After this operation, 477 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe python-pip all 1.5.4-1ubuntu3 [97.2 kB]
Now it’s’ time to installPowerlinelatest development version from theGitrepository. For this, your system must have git package installed in order to fetch the packages from Git.
```
# apt-get install git
# yum install git
# dnf install git
```
Next you can installPowerlinewith the help ofpipcommand as shown.
Cloning git://github.com/Lokaltog/powerline to /tmp/pip-WAlznH-build
Running setup.py (path:/tmp/pip-WAlznH-build/setup.py) egg_info for package from git+git://github.com/Lokaltog/powerline
warning: no previously-included files matching '*.pyc' found under directory 'powerline/bindings'
warning: no previously-included files matching '*.pyo' found under directory 'powerline/bindings'
Installing collected packages: powerline-status
Found existing installation: powerline-status 2.2
Uninstalling powerline-status:
Successfully uninstalled powerline-status
Running setup.py install for powerline-status
warning: no previously-included files matching '*.pyc' found under directory 'powerline/bindings'
warning: no previously-included files matching '*.pyo' found under directory 'powerline/bindings'
changing mode of build/scripts-2.7/powerline-lint from 644 to 755
changing mode of build/scripts-2.7/powerline-daemon from 644 to 755
changing mode of build/scripts-2.7/powerline-render from 644 to 755
changing mode of build/scripts-2.7/powerline-config from 644 to 755
changing mode of /usr/local/bin/powerline-config to 755
changing mode of /usr/local/bin/powerline-lint to 755
changing mode of /usr/local/bin/powerline-render to 755
changing mode of /usr/local/bin/powerline-daemon to 755
Successfully installed powerline-status
Cleaning up...
```
### Step 3: Installing Powerline Fonts in Linux
Powerline uses specialglyphsto show special arrow effect and symbols for developers. For this, you must have a symbol font or a patched font installed on your systems.
Download the most recent version of the symbol font and fontconfig configuration file using following[wget command][5].
Then you need to move the font to your fonts directory,/usr/share/fonts/or/usr/local/share/fontsas follows or you can get the valid font paths by using command`xset q`.
```
# mv PowerlineSymbols.otf /usr/share/fonts/
```
Next, you need to update your system’s font cache as follows.
```
# fc-cache -vf /usr/share/fonts/
```
Now install the fontconfig file.
```
# mv 10-powerline-symbols.conf /etc/fonts/conf.d/
```
Note: If custom symbols doesn’t appear, then try to close all terminal sessions and restart X window for the changes to take effect.
### 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 support256colorby adding the following line to~/.bashrcfile 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~/.bashrcfile.
First get the location of installedpowerlineusing following command.
Try changing or switching to different directories and keep a eye on “breadcrumb” prompt changes to show your current location.
You will also be able to watch pending background jobs and if powerline is installed on a remote Linux machine, you can notice that the prompt adds the hostname when you connect via SSH.
#### Enable Powerline for Vim
Ifvimis 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
```
Now you can launch vim and see a spiffy new status line:
Powerlinehelps to set colorful and beautiful statuslines and prompts in several applications, good for coding environments. I hope you find this guide helpful and remember to post a comment if you need any help or have additional ideas.
I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+