1

I'm trying to set up patched fonts from powerline/fonts with airline in gvim under Windows 10 64 bit. As you can see from the screenshot here:

gvim with ProFont for Powerline

the characters from the font do show up, but the airline itself doesn't seem to output the special characters. I'm using the set guifont=ProFont\ for\ Powerline:h12 directive in my ~/_vimrc. Also, it is strange that although I installed vim-airline through Vundle (with Plugin 'vim-airline/vim-airline', then :PluginInstall), the airline commands are apparently not recognized, for example :AirlineExtensions gives the error message shown in the screenshot.

Airline also doesn't work in plain vim on my setup with ProFont for Powerline set through the terminal Font settings. How do I set airline correctly in both vim and gvim?

Edit: Here's my _vimrc.

Edit 2: Apparently :scriptnames shows that vim-airline isn't actually sourced, and vim-airline-themes is, even though both are installed under ~/vimfiles/bundle/ (vim-airline is in ~/vimfiles/bundle/vim-airline/ and vim-airline-themes is in ~/vimfiles/bundle/vim-airline-themes/)? Also, :echo exists("loaded_airline_themes") gives 1, but :echo exists("loaded_airline") gives 0.

Edit 3: I apparently also had a leftover lightline in global vim plugin directory, which was giving the output in the screenshot. I removed it, but now the airline still doesn't show, and this is the output of :scriptnames.

Status line after removing lightline

  • 1
    If you're trying to use those fonts then why do you have all that symbols stuff? I'd delete everything after let g:airline_powerline_fonts = 1 which makes everything else redundant at best. Not saying that'll fix everything but you ought to start from a clean place. – B Layer Aug 13 at 10:03
  • 1
    Instead of a screen grab I suggest you post, as text, all the airline related lines from your vimrc. You can just enter the error message as text, too...the image isn't adding much and can't be selected/copied like text. Oh, and welcome to Vi&Vim SE. ;) – B Layer Aug 13 at 10:13
  • @BLayer I started with a clean _vimrc and then tried different settings. Regardless, airline should output the symbols like this as well, no? I'll add my _vimrc in the original post. – Vilinkameni Aug 13 at 10:31
  • 1
    g:airline_powerline_fonts = 1 means airline will automatically populate the g:airline_symbols dictionary so by specifying it yourself you're wasting time at best and overwriting the dictionary at worst. (FYI I use airline + powerline fonts and the only airline config I have in my vimrc is that one assignment.) – B Layer Aug 13 at 11:16
1

I found a workaround. Manually copying the entire vim-airline tree under the $HOME/vimfiles/pack/plugins/start/ did the trick, as the vim-airline plugin was then able to be loaded at startup. For some reason, simply installing vim-airline via Vundle doesn't make it able to be loaded on startup on both of my setups, unlike other packages.

Update: I also found the exact culprit. Apparently, the call to the plugin rstacruz/sparkup (contained in the suggested .vimrc from the Vundle documentation) is causing both that plugin and the plugin referenced in the subsequent Plugin directive to fail to be sourced. Commenting out the offending line fixed the problem:

" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
" v----- Doesn't work AND messes up the next 'Plugin' call -----v
"Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}

Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'

Update 2: There is an issue on Vundle's GitHub page referencing this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.