Skip to content

Instantly share code, notes, and snippets.

@leosuncin
Last active October 12, 2023 18:00
Show Gist options
  • Save leosuncin/25bad6ae66c5d513b986 to your computer and use it in GitHub Desktop.
Save leosuncin/25bad6ae66c5d513b986 to your computer and use it in GitHub Desktop.
Install Powerline on Debian/Ubuntu
  1. Install pip sudo apt-get install python-pip or wget https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py
  2. Install powerline sudo pip install powerline-status
  3. Download and install fonts git clone https://github.com/powerline/fonts.git && cd fonts && sh ./install.sh
  4. Add this lines to respective file
    .vimrc

set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
" Use 256 colours (Use this setting only if your terminal supports 256 colours)
set t_Co=256

.bashrc

if [ -f /usr/local/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh ]; then
source /usr/local/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh
fi

.zshrc

if [[ -r /usr/local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh ]]; then
source /usr/local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh
fi

.tmux.conf

source /usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf
set-option -g default-terminal "screen-256color"

@johnjimysom
Copy link

johnjimysom commented Jun 28, 2021

Something isn't sitting right - following the steps but my bash prompt still indicates problems rendering some characters indicated by the small question mark icons. And yes I did run powerline.sh to source the file
image

You have to set your font by the preferences of Ubuntu 18.04 LTS, right click the window to get to it. You will need to install the fonts first,

https://www.nerdfonts.com/font-downloads for fonts to use. Unzip a font and install it to Windows and then change the font using Ubuntu preferences.

Reason why you are getting question mark boxes because the default Windows font don't have the powerline fonts (because they don't have the fancy symbols), you have to set it to the ones that you downloaded and installed. Restart the app and then it should change. Assuming you are doing WSL Ubuntu. Sample of mines
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment