Powerline

Powerline is a statusline plugin for Vim, and provides statuslines and prompts for several other applications, including zsh, bash, fish, tmux, IPython, Awesome, i3 and Qtile.

Installation

Install powerline and powerline-fonts.

Note: Installing powerline-fonts does not provide any of the patched fonts from powerline-fonts-gitAUR

Usage

Bash

Add the following to your bashrc:

~/.bashrc
powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /usr/share/powerline/bindings/bash/powerline.sh

Close and reopen your terminal and it should be working. If not, check the Powerline bash prompt usage instructions to ensure that it has not changed.

Tip: You can also source it afterwards if you do not want to close and re-open your terminal.

Zsh

Add the following to your zshrc:

~/.zshrc
powerline-daemon -q
. /usr/share/powerline/bindings/zsh/powerline.zsh
Note: If you are using oh-my-zsh, you should delete or comment out the ZSH_THEME=oh-my-zsh theme" line in your ~/.zshrc. Similarly if you are using grml-zsh-config, do not forget to insert prompt off before the above addition.

Fish

Add the following to your config.fish:

~/.config/fish/config.fish
set fish_function_path $fish_function_path "/usr/share/powerline/bindings/fish"
source /usr/share/powerline/bindings/fish/powerline-setup.fish
powerline-setup

Restart your terminal emulator and it must work.

Tmux

Add the following to your tmux.conf:

~/.config/tmux/tmux.conf
 source /usr/share/powerline/bindings/tmux/powerline.conf
Note:
  • It is sufficient to just add this to the tmux configuration: adding anything to your shell configuration is not necessary.
  • Watch out for interfering styles in the tmux configuration (i.e. window-status-format).

Vim

Install .

Detailed usage

For detailed usage instructions, such as configuring your system to use Powerline with other shells, window manager widgets, etc., please refer to the Usage section of the Powerline documentation.

Customizing

The official Powerline documentation refers to powerline_root, which for Arch Linux is the following:

/usr/lib/python3.x/site-packages/powerline

To customize Powerline, copy a default configuration to . Then edit the file to your liking.

Example to customize Powerline for tmux:

$ mkdir -p ~/.config/powerline/themes/tmux/
$ cp /usr/lib/python3.x/site-packages/powerline/config_files/themes/tmux/default.json ~/.config/powerline/themes/tmux/default.json

Tips and tricks

Using python-pip

Using a vim plugin manager

There are many vim plugin managers available which are able to install and update Powerline, assuming you are using a version of vim with Python support or you install python. For example, using vim-plugAUR, add the following to your file:

Substitute with the actual directory, such as , and run the vim-plug command within vim. This will download Powerline from the Powerline GitHub page to the specified plugin directory and add it to vim.

Alternative fonts

A reduced set of fonts for the text console are available in .

Alternative package

There is currently one known alternative to Powerline — Vim-airline. It is a part of vim-plugins and can be installed separately as . Optionally, install .

Note: In vim-airline, showing the current git branch relies on vim-fugitive. vim-fugitive v2.4 made a change that broke this feature. Upstream will not tag a new release with the single commit that fixes compatibility with vim-fugitive v2.4. Until then, if you want to see the current git branch, you have to: use vim-airline-gitAUR; downgrade vim-fugitive to v2.3; or make your own vim-airline v0.9.0, cherry-picking upstream's fixing commit. If you decide to cherry-pick, it does not apply cleanly, so you will need to fix that too.

Troubleshooting

Fonts: glyphs missing

If you installed powerline-fonts but you notice missing glyphs, make sure your locale is set. Restart your session to see the changes.

gollark: I can actually *write* without looking to some extent.
gollark: That may be our first non-demonstrational use of <:snub_dodecadodecahedron:800390497431715901>.
gollark: Also, mathematics *is* real and it is *behind you*.
gollark: (mod 2)
gollark: 1 *is* 3, in fact.
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.