I've recently started moving over to gvim from vim on Windows. I managed to get the terminal version set up properly, and the fonts render there.
In Vim, it works fine:
But in gvim, the powerline symbols are broken:
I'm honestly not sure where the problem lies.
The main difference between Vim in Cygwin and gvim is how the font is set up. Cygwin has a separate option for it on a window-level basis, while it appears that gvim follows set guifont
.
I set both to use Source Code Pro for Powerline (also did a fresh install from powerline/fonts)
Following another post, I also tried with guifontwide
, neither of which worked.
Manually adding the symbols (suggested here) results in this within gvim:
But in Vim, and surprisingly Notepad++, the symbols render properly.
(In theory a) minimal .vimrc (for reference, using Vim-Plug):
[...]
Plug 'vim-airline/vim-airline-themes'
Plug 'vim-airline/vim-airline'
[...]
set guifont=Source\ Code\ Pro\ for\ Powerline:h11:cANSI " Font
set guifontwide=Source\ Code\ Pro\ for\ Powerline:h11:cANSI " gvim (?)
let g:airline_theme='tomorrow'
let g:airline_powerline_fonts = 1
let g:airline#extensions#ale#enabled = 1
" and the symbol definitions after this, but the issue is there with or without them.
The Cygwin vimrc is slightly different from the gvim vimrc, but that code (aside set guifont
and set guifontwide
) is present in both. Same theme, same system, same font, and overall the same plugins.
There's nothing wrong with the fonts themselves, so it's probably a configuration issue somewhere. What am I missing?
utf-8
, needs to be the very first in your .vimrc. possibly also need to setscriptencoding
toutf-8
termencoding
set to UTF-8, replacing it withset encoding=utf-8
andset fileencoding=utf-8
actually fixed it