How can I setup my vim-airline or vim-powerline
Asked Answered
H

3

58

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.

Hymn answered 30/9, 2013 at 22:56 Comment(5)
"For terminal users: Update your terminal configuration to use the patched font." Did you reset your terminal font to the patched font? If you're on gvim you set it with set guifont. Otherwise, change it in your terminal settings.Poly
Those plugins have issue trackers. Use them.Pubes
@doliver: yes I changed the font via the contextual menu of gvim Edit>Select font... then I selected a font I installed...Hymn
I don't think that's enough for gvim. You need to set guifont and probably utf-8 encoding and maybe a couple of other things. Also, you might try clearing the cache, I think it's :PowerlineClearCache. I would just copy my plugin settings but I got rid of powerline because I use the same vim configuration on Windows and Linux and also I found that it didn't actually improve my workflow. Did you read ":help Powerline"? Aside from that, you need to read the fontpatcher info on github.Poly
I'm voting to close this question as off-topic because this belongs on Vi and VimRabkin
S
63

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

Skitter answered 2/10, 2013 at 12:41 Comment(2)
Thanks I did all that... but did not restart the box...do all was screwed anyway. The airline author fixed my other problem (I change colorscheme on the fly which was causing problems). CheersHymn
I'm using Windows 7 and when I download the .TTF files from Lokaltog's github repo and double-click on it the Windows font viewer tells me that that the file is not a valid font file. Any ideas about how to make this work on Windows 7?Esse
R
33

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.

Randirandie answered 24/7, 2014 at 15:7 Comment(1)
On windows with gvim you might have to add set encoding=utf-8 for these to render properly.Nessie
K
8

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
Kiln answered 13/7, 2014 at 14:36 Comment(1)
This is the only line I had to add.Provisory

© 2022 - 2024 — McMap. All rights reserved.