Powerline Installation Issues for Vim/Tmux on Mac OSX 10.10.5

Question:

I’ve tried multiple times to follow the installation instructions for Powerline outlined here, but no matter what I do, these status bar just doesn’t appear.

I’m on Yosemite and trying to install Powerline for Vim with Tmux for a Python dev environment.

Here’s my ~/.vimrc file:

set nocompatible              " be iMproved, required
filetype off                  " required                                        

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

Here’s my ~/.tmux.conf file:

source '{repository_root}/powerline/bindings/tmux/powerline.conf'

I manually installed the fonts (the install.sh script just wasn’t working for me), which you can get here.

All I’m seeing in Tmux is just the standard, default green line with bash, user name, and date info. I’m know I’m probably missing something obvious here, but any suggestions for what I need to look at or fix?

Asked By: SeanJarp

||

Answers:

I suggest you give vim-airline a try. It’s entirely written in vimscript and is very lightweight compared to powerline. There’s no python dependency, it’s very easy to setup and works great out of the box.

It integrates really well with other plugins like tmuxline, promptline,

Answered By: ronakg

If you don’t want to try ronkag’s suggestion of trying vim-airline, here’s some things to try to get Powerline working correctly on your setup:

1. You’re ~/.vimrc looks a little funny, like it might be missing some stuff. Here’s mine for reference:

set nocompatible              " be iMproved, required
filetype off                  " required                                        

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'


" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'

" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'


" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

source /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/powerline/bindings/vim/plugin/powerline.vim
set laststatus=2         

if has("gui_running")
       let s:uname = system("uname")
          if s:uname == "Darwinn"
                    set guifont=Inconsolata for Powerline:h15
                       endif
                   endif


set guifont=Inconsolata for Powerline:h15
let g:Powerline_symbols = 'fancy'
set encoding=utf-8
set t_Co=256
set fillchars+=stl: ,stlnc:
set term=xterm-256color
set termencoding=utf-8


"these are taken from fullstackpython.com

" enable syntax highlighting
syntax enable

" show line numbers
set number

" set tabs to have 4 spaces
set ts=4

" indent when moving to the next line while writing code
set autoindent

" expand tabs into spaces
set expandtab   

" when using the >> or << commands, shift lines by 4 spaces
set shiftwidth=4

" show a visual line under the cursor's current line 
set cursorline

" show the matching part of the pair for [] {} and ()
set showmatch

" enable all Python syntax highlighting features
let python_highlight_all = 1 

2. What you have in your ~/.tmux.conf file doesn’t look right either. You have to specify the actual file path of where the powerline.conf file is. For example, mine looks like this:

source /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf

3. Assuming you did correctly install all of the fonts from the fonts package (you should double check since you did it manually), and this may be an obvious one, but don’t forget to select a Powerline font in Terminal preferences! Any font that has “for powerline” in it should work.

Python 2.7 is not present in newer versions of OSX so I had to install powerline using Python3 like below (notice I’m using pip3 not pip):

brew install python
pip3 install powerline-status

The first command above installed Python 3.10 for me. I already had Python 3.9 so I don’t think the first line is needed.

This installed powerline bindings under /Users/{replace_your_user_name}/Library/Python/3.10/lib/python/site-packages/powerline/bindings/

In .tmux.conf I added this line:

source '/Users/{replace_your_user_name}/Library/Python/3.10/lib/python/site-packages/powerline/bindings/tmux/powerline.conf'

This didn’t work until I added folder containing powerline-config to the PATH. All worked after I added this to my .zshrc

export PATH=$PATH:/Users/{replace_your_user_name}/Library/Python/3.10/bin
Answered By: Abdullah Javid
Categories: questions Tags: , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.