I love Powerline. Unfortunately, setting up just about any linux-centric software on windows is an everloving pain in the ass. Powerline is no different, and there don’t seem to be any start-to-finish this-is-what-worked Windows guides. Here’s mine.
First up, install Python. I used the Python guide exactly to set up 2.7, set the path, then install easy-install and pip.
With that out of the way, you should be able to install Powerline with pip:
pip install --user git+git://github.com/Lokaltog/powerline
You’ll need an appropriately-patched font for Powerline to look right. Take your pick from https://github.com/Lokaltog/powerline-fonts – download the .otf of your choice, then right-click it and click “install” to install it in Windows.
At this point, you can go ahead and download vim73-x64.zip from https://code.google.com/p/vim-win3264/downloads/list. Extract this and copy everything into
C:\Program Files\vim73-x64. From
C:\Program Files\vim73-x64\vim73, right-click ‘install.exe’ and ‘Run as Administrator’. This will create some useful batch files and whatnot so you can “gvim myfile” from the normal windows command prompt.
The final piece of the puzzle is activating everything in vim. Here’s my
C:\Users\Alex Whittemore\_vimrc contents:
"Strictly necessary for Powerline
"Set to whatever font you like.
set guifont=Inconsolata\ for\ Powerline:h12
python from powerline.vim import setup as powerline_setup
python del powerline_setup
NOTE: Change the font line to be appropriate for whatever you downloaded and installed earlier.
UPDATE: I got sick of not having powerline on the commandline vim inside cygwin. Here’s what I did to fix that:
- Make sure you have python installed in Cygwin, and that vim knows it. I luckily already did: inside vim,
:python import sys; print(sys.version)reveals I have python 2.7.5. Good enough.
- easy_install pip, then
1pip install git+git://github.com/Lokaltog/powerline
though for some reason this would simply NOT install to where I thought it would! My python path was all messed up, so
to your cygwin
.bashrc. Assuming pip installed powerline here as was the case for me, this will sort out the powerline module presence in vim. Note: change YOURUSERHERE so that the path is correct on your system.
- You’ll need to set your ~/.vimrc, which is not the same as your windows home dir/_vimrc from before. Copy the contents over, or wait for the last step below.
- At this point, you should have a functional, but broken-looking powerbar in your cygwin terminal vim. Next step, font: change the cygwin terminal font to an appropriately patched one: right-click the cygwin logo, options>text>select. I just changed it to Inconsolata here as well, because I like it, but you could get a patched lucida console or whatnot as well so your terminal font doesn’t change outside of vim.
- FINALLY: the colors are broken. Easy. Make sure your .vimrc contains the last line in my full .vimrc below:
Vim12345678910111213141516171819202122232425262728293031323334"My preferencessyntax onset shiftwidth=4set autoindentset expandtabset tabstop=4set softtabstop=4set numberset backspace=indent,eol,startset nowritebackupset nobackupset noswapfilesyntax enableif has('gui_running')set background=lightset t_Co=16"let g:solarized_termcolors=16"colorscheme solarizedendifset laststatus=2"Strictly necessary for Powerlineset encoding=utf-8"Set to whatever font you like.set guifont=Inconsolata\ for\ Powerline:h12python from powerline.vim import setup as powerline_setuppython powerline_setup()python del powerline_setup"Important for terminal vim to work in cygwin.set term=xterm-256color