在vim-airline中遇到字体问题


18

我想安装vim-airline,但是unicode字体有问题。

我已经安装了vundle:

.vimrc

set encoding=utf-8
Bundle 'bling/vim-airline'
let g:airline_powerline_fonts = 1
let g:airline_theme='powerlineish'

.fonts

$ ll .fonts
total 376
drwxr-xr-x 2 xxx xxx   4096 gru 19 13:26 AnonymousPro
drwxr-xr-x 2 xxx xxx   4096 gru 19 13:26 DejaVuSansMono
-rw-r--r-- 1 xxx xxx 334548 gru 19 13:42 DejaVu Sans Mono for Powerline.ttf
drwxr-xr-x 2 xxx xxx   4096 gru 19 13:26 DroidSansMono
drwxr-xr-x 2 xxx xxx   4096 gru 19 13:26 Inconsolata
drwxr-xr-x 2 xxx xxx   4096 gru 19 13:26 InconsolataDz
drwxr-xr-x 2 xxx xxx   4096 gru 19 13:26 LiberationMono
drwxr-xr-x 2 xxx xxx   4096 gru 19 13:26 Meslo
drwxr-xr-x 2 xxx xxx   4096 gru 19 13:42 PowerlineSymbols
-rw-r--r-- 1 xxx xxx   1599 gru 19 13:26 README.rst
drwxr-xr-x 2 xxx xxx   4096 gru 19 13:26 SourceCodePro
drwxr-xr-x 5 xxx xxx   4096 gru 19 13:26 Terminus
drwxr-xr-x 2 xxx xxx   4096 gru 19 13:26 UbuntuMono


fc-cache -vf ~/.fonts
/home/xxx/.fonts: caching, new cache contents: 1 fonts, 11 dirs
/home/xxx/.fonts/AnonymousPro: caching, new cache contents: 4 fonts, 0 dirs
/home/xxx/.fonts/DejaVuSansMono: caching, new cache contents: 4 fonts, 0 dirs
/home/xxx/.fonts/DroidSansMono: caching, new cache contents: 1 fonts, 0 dirs
/home/xxx/.fonts/Inconsolata: caching, new cache contents: 1 fonts, 0 dirs
/home/xxx/.fonts/InconsolataDz: caching, new cache contents: 1 fonts, 0 dirs
/home/xxx/.fonts/LiberationMono: caching, new cache contents: 4 fonts, 0 dirs
/home/xxx/.fonts/Meslo: caching, new cache contents: 6 fonts, 0 dirs
/home/xxx/.fonts/PowerlineSymbols: caching, new cache contents: 1 fonts, 0 dirs
/home/xxx/.fonts/SourceCodePro: caching, new cache contents: 7 fonts, 0 dirs
/home/xxx/.fonts/Terminus: caching, new cache contents: 0 fonts, 3 dirs
/home/xxx/.fonts/Terminus/BDF: caching, new cache contents: 18 fonts, 0 dirs
/home/xxx/.fonts/Terminus/PCF: caching, new cache contents: 18 fonts, 0 dirs
/home/xxx/.fonts/Terminus/PSF: caching, new cache contents: 0 fonts, 0 dirs
/home/xxx/.fonts/UbuntuMono: caching, new cache contents: 4 fonts, 0 dirs
/var/cache/fontconfig: not cleaning unwritable cache directory
/home/xxx/.cache/fontconfig: cleaning cache directory
/home/xxx/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded

但是我仍然有那些符号

在此处输入图片说明

我什至尝试将符号插入到 .vimrc

let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''

但是它们是这样插入的:

在此处输入图片说明

Answers:


23

解决方案是选择我在Gnome终端中安装的字体(带有Powerline修复的字体):

在gnome终端处于活动状态的情况下,单击“编辑”>“配置文件首选项”

在此处输入图片说明

现在,tmux中的字体可以正常工作。

链接到电力线的工作字体在这里:

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


我只是这样做,但仍然有完全相同的问题。我在Mac上使用iterm在Mac上使用了相同的路径,并且在iterm中选择字体效果很好,但是在gnome终端中我看不到任何变化。
巴斯蒂安2015年

1
这就是答案!
user3751385 2016年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.