在Mac 10.8的vim中配置Powerline字体 [英] Configuring Powerline fonts in vim on Mac 10.8

查看:197
本文介绍了在Mac 10.8的vim中配置Powerline字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试从获取字体,但是没有任何区别。实际上,将 guifont 更改为 Wingdings:h14 不起作用。

如何检查vim是否可以支持电力线?我怎样才能让字体正常工作?如果在控制台中运行vim(<$),则更改终端字体。 c $ c> guifont 什么都不做)。

更长的答案 b $ b

vim --version 我发现了这行:没有GUI的巨大版本



打开vim并检查:help guifont 进一步显示选项是 {only only when编译时使用GUI启用}



当直接在控制台(如终端)运行vim时,vim无法控制字体,正如此处的评论部分所述。在这种情况下,我的问题的解决方案只是改变整个控制台的字体,在终端下Preferences-> Settings-> Text。

有可能通过Macports与 + gtk2 编译vim,但我无法得到 guifont 有任何作用。



希望这可以帮助别人避免一个简单的错误。


I am trying to get the custom fonts from powerline-fonts to work with powerline. I am running vim 7.4, compiled with Macports, on Mac OS 10.8.

I'm using vundle to install powerline (and other tools not shown here):

set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}

I've downloaded the powerline-fonts repo, and successfully installed the fonts into Font Book. I then added the following to vimrc:

set encoding=utf8
set termencoding=utf8
set guifont=Droid\ Sans\ Mono\ for\ Powerline:h14
let g:Powerline_symbols='unicode'
set t_Co=256
set laststatus=2
set noshowmode
set fillchars+=stl:\ ,stlnc:\

However, when I run vim, I am greeted with box symbols instead of arrows, as shown below (taken from this SO question).

I have tried to switch the fonts around, and have used all of the fonts available from powerline-fonts, but there is never any difference. In fact, changing guifont to Wingdings:h14 has no effect.

How do I check that vim can support powerline? How may I get fonts working correctly? Thanks.

解决方案

Short Answer: change the terminal font if running vim in a console (guifont does nothing).

Longer Answer:

In vim --version I've discovered the line: Huge version without GUI.

Opening vim and checking :help guifont further shows that the option is {only available when compiled with GUI enabled}.

When running vim directly in a console, such as Terminal, vim does not have the ability to control the font, as discussed in the comment section here. In this instance, the solution to my problem is simply to change the font of the entire console, available in Terminal under Preferences->Settings->Text.

It is possible to compile vim via Macports with +gtk2, but I was unable to get guifont to have any effect.

Hope this helps others avoid a simple mistake.

这篇关于在Mac 10.8的vim中配置Powerline字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆