我想安装 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 = ''
但它们被插入如下:
答案1
解决方案是在 Gnome 终端中选择我已经安装的字体(带有 Powerline 修复的字体):
在 gnome-terminal 处于活动状态时,单击“编辑”>“配置文件首选项”
现在 tmux 中的字体可以正常工作。
电力线可用字体的链接在这里: