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

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...


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.


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