如何在 Vim 中设置默认字体大小? [英] How do I set the default font size in Vim?
问题描述
我正在尝试使用 Vim 为我的 GUI 配置默认设置.我已经在网络上进行了研究,但是我找到并尝试过的所有解决方案都不起作用.
I am trying to configure the default settings for my GUI with Vim. I already made research on the web, but all the solutions I found and tried did not work.
以下是我尝试的一些方法(在 .vimrc 文件中):
Here are some of the things I tried (in the .vimrc file):
set guifont = Monaco:h20
set guifont=Monospace 20
其实我并不关心 Monaco 字体.
Actually I don't care about the Monaco font.
推荐答案
对于第一个删除空格.空格对于 set 命令很重要.
For the first one remove the spaces. Whitespace matters for the set command.
set guifont=Monaco:h20
对于第二个应该是(h 指定高度)
For the second one it should be (the h specifies the height)
set guifont=Monospace:h20
我对设置字体的建议是这样做(如果您的版本支持)
My recommendation for setting the font is to do (if your version supports it)
set guifont=*
这将弹出一个菜单,允许您选择字体.选择字体后,输入
This will pop up a menu that allows you to select the font. After selecting the font, type
set guifont?
显示当前 guifont 的设置.之后将该行复制到您的 vimrc 或 gvimrc 中.如果字体中有空格,请添加 以转义空格.
To show what the current guifont is set to. After that copy that line into your vimrc or gvimrc. If there are spaces in the font add a to escape the space.
set guifont=Monospace 20
这篇关于如何在 Vim 中设置默认字体大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!