macvim 改变字体大小?
我正在使用 macvim,我喜欢它。我也很喜欢默认字体。
我的问题是:
如何更改 .gvimrc 中的字体大小?我希望它更大,而不改变默认字体。
我见过的所有示例都指定了字体,然后是“:”,然后是大小。
那么我该如何更改大小而不是字体本身呢?
谢谢!
I'm using macvim and I love it. I also happen to really like the default font.
My question is:
How do I change the font size in my .gvimrc? I want it to be bigger, without changing the font from the default.
All the examples I've seen specify a font then a ':' then the size.
So how do I just change the size not the font itself?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
更改 vim 控制台 字体大小可以增大或减小
对于 Macvim,以下快捷键
适用于 终端
Changing the size in vim console font size can increase or decrease
For Macvim following key shortcut work
For Terminal
⌘-= 和 ⌘-- 将分别增大和减小字体大小。
⌘-= and ⌘-- will increase and decrease the font size, respectively.
这对我来说效果很好。
:set guifont=Menlo\ 常规:h12
This works great my end.
:set guifont=Menlo\ Regular:h12
响应中缺少一个有用的注释 - 您可以使用
set guifont=*
这将打开一个字体选择器,供您从系统上的可用字体中进行选择。它可能仅限于 OSX 和 Linux,但比手动输入更好。选择字体后,您可以再次使用
set guifont
,它将打印出字体的名称和您选择的大小。唯一需要注意的是 ~/.vimrc 中的任何空格都需要反斜杠One useful note is missing from the responses - you can use
set guifont=*
which will bring up a font-picker for you to select from the available fonts on the system. It might be OSX and Linux only, but preferable to having to enter it manually.Once you've selected the font, you can use
set guifont
again which will print out the name of the font and the size you've selected. The only caveat being that any spaces need to be backslashed in your ~/.vimrc如果您不介意弹出菜单,设置字体的快速方法是输入
:set gfn=*
。这将允许您调整字体的任何属性,而无需更改任何其他内容。
然后你可以使用
:set gfn
查看它现在的设置并将其添加到你的 .vimrc 中。举个例子,在我的例子中,它显示
guifont=Monaco:h12
,因此为了在启动时获得相同的设置,我将set gfn=Monaco:h12
添加到我的.vimrc。A quick way to set the font if you don't mind a menu popping up is to type
:set gfn=*
.This will allow you to adjust any property of the font without changing anything else about it.
Then you can use
:set gfn
to see what it is now set to and add that to your .vimrc.As an example, in my case it shows
guifont=Monaco:h12
and so in order to get the same setting on startup, I addedset gfn=Monaco:h12
to my .vimrc.以上答案都不适合我,以下是解决方案:
添加到您的 .gvimrc,对于 janus 用户,其 ~/.gvimrc.after :
None of the above answers worked for me, here is what worked out:
Add to your .gvimrc, for the janus users its ~/.gvimrc.after :
默认字体为 Bitstream Vera< /a>(在该页面上搜索“默认字体”)。那么为什么不直接指定它,而是使用不同的字体大小呢?例如,
这种方法还可以确保,如果将来默认值发生更改(例如,更改为系统默认值
Monaco
),您仍然可以启用自己喜欢的字体。The default font is Bitstream Vera (search for 'default font' on that page). So why not just specify that, but with a different font size? E.g.
This approach also ensures that if in future the default changes (e.g. to the system default,
Monaco
), you will still have your preferred font enabled.