How can I setup my vim-airline or vim-powerline

VimVim PowerlineVim Airline

Vim Problem Overview


I am trying to install vim-powerline, new-powerline, or vim-airline on Windows 7 on a 64bit version of vim, but I cannot get them to work.

In vim-powerline, I get the status line, but can't see the nice < delimiters.

> vim-powerline

I installed the plugin via Vundle and updated the configuration file.

let g:Powerline_symbols = 'fancy'
set encoding=utf-8
set t_Co=256
set fillchars+=stl:\ ,stlnc:\
let g:Powerline_mode_V="V·LINE"
let g:Powerline_mode_cv="V·BLOCK"
let g:Powerline_mode_S="S·LINE"
let g:Powerline_mode_cs="S·BLOCK"

Any combination looks pretty much the same. It seems that one might have to install new fonts, but there is no how-to for Windows.

With vim-airline, I finally found those fonts looking at the vim-airline plugin. Once again I can't get it quite right: I can see some ugly <<.

> vim-airline-pict

This is not the beautiful screenshot provided on the bling/vim-airline repository.

Vim Solutions


Solution 1 - Vim

You didn't use a patched font! Patching means manually adding the six extra symbols to the font at specific places in UTF formatted fonts. If these symbols are not present, you get the ugly placeholder blocks, which you are getting. You can either patch by yourself using fontforge (not easy!) or you can simply download and install a pre-patched font from this page:

https://github.com/Lokaltog/powerline-fonts

Installing a font in Windows is easy: Rightclick and choose Install. Then you set it as usual like this in your _vimrc:

set guifont=Liberation_Mono_for_Powerline:h10 

Linux .vimrc for completeness

set guifont=Liberation\ Mono\ for\ Powerline\ 10 

Then for airline

let g:airline_powerline_fonts = 1

or powerline

let g:Powerline_symbols = 'fancy'

Other settings are merely optional.

Restart and enjoy *line.


If you patch manually, here's a hint I learned painfully: After patching the normal font don't forget to patch the bold and italic fonts as well...

Solution 2 - Vim

I had a similar issue for vim-airline and I resolved it by reading the help file (:h airline) and scrolling down to the customization section.

Copy the following lines into the .vimrc file.

if !exists('g:airline_symbols')
  let g:airline_symbols = {}
endif

" Unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'

Start a new terminal session and launch Vim.

Solution 3 - Vim

I had the same the same problem and it was fixed by simply adding the following line to the .vimrc file.

let g:airline_powerline_fonts = 1

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionstatquantView Question on Stackoverflow
Solution 1 - VimfreeoView Answer on Stackoverflow
Solution 2 - VimKingsley IjomahView Answer on Stackoverflow
Solution 3 - Vimchxj1992View Answer on Stackoverflow