Gvim 7.4:如何保存默认字体设置?gvim 7.3 有什么改进吗?

Joh*_*son 6 fonts gvim gvimrc default-settings

如以下帖子所示:

如何更改 gVim 的默认字体

在 Windows 7 上,无法从 Gvim 程序中保存默认的 Gvim 字体。关闭 Gvim 会导致它完全忘记所有字体设置,并且无法在 _vimrc 文件中设置它们。

这是否已在 Gvim 7.4 中修复或此错误是否仍然存在?或者有人知道设置默认字体的更好方法吗?因为 FixedSys 字体很糟糕,因为它不能显示捷克字符,而且我不想每次打开包含捷克字符的文件时都必须去菜单更改它。谢谢。

** 编辑 **

好的,现在我看到了通过发出 Gvim 命令来设置字体的文档

:help guifont
Run Code Online (Sandbox Code Playgroud)

这是我发现的:

For the Win32 GUI                   *E244* *E245*
- takes these options in the font name:
    hXX - height is XX (points, can be floating-point)
    wXX - width is XX (points, can be floating-point)
    b   - bold
    i   - italic
    u   - underline
    s   - strikeout
    cXX - character set XX.  Valid charsets are: ANSI, ARABIC,
          BALTIC, CHINESEBIG5, DEFAULT, EASTEUROPE, GB2312, GREEK,
          HANGEUL, HEBREW, JOHAB, MAC, OEM, RUSSIAN, SHIFTJIS,
          SYMBOL, THAI, TURKISH, VIETNAMESE ANSI and BALTIC.
          Normally you would use "cDEFAULT".

  Use a ':' to separate the options.
- A '_' can be used in the place of a space, so you don't need to use
  backslashes to escape the spaces.
- Examples:  
    :set guifont=courier_new:h12:w5:b:cRUSSIAN
    :set guifont=Andale_Mono:h7.5:w4.5
Run Code Online (Sandbox Code Playgroud)

所以现在例如在 Gvim 中,我可以执行以下操作:

:set guifont=Lucida_Console:h12:cDEFAULT
Run Code Online (Sandbox Code Playgroud)

我可以把命令

set guifont=Lucida_Console:h12:cDEFAULT
Run Code Online (Sandbox Code Playgroud)

C:\Users\JSonderson_gvimrc 中,每次启动 gvim 时都会加载这个字体系列、字体大小和字符集。


但是还有一个问题,就是为什么UTF-8不在字符集列表中?

无论如何,字符集不是与字体分开的吗?

字符集和字符编码有什么区别?

当我使用 DEFAULT 设置时,如何显示正在使用的实际字符集?

谢谢。

小智 6

在 Windows 10 上,我必须将此行添加到用户主目录中的 _vimrc 以使字体设置持久化:(默认设置为 Consolas 大小 10)。

设置 guifont=Consolas:h10


小智 0

我正在使用 GVIM 8.0.69。我已经编辑它vimrc_example.vim以添加以下行:

set guifont=Consolas:h10

:saveas _guirc将配置文件保存在默认主文件夹 GVIM 中。

重新启动。我有新的默认字体。