vscode 配置Maple Mono 中英文等宽字体

作者:matrix 发布时间:2025-03-19 分类:零零星星

https://font.subf.dev/zh-cn/

vscode的默认字体如果中英文混合的话会发现不等宽,也就是垂直方向无法完整对其。Maple Mono开源字体,正好可以完美显示。

环境:macos

安装

font-maple-mono-nf-cn 会包含nf图标以及中文字体。可以按需选择想要的字体集

$ brew install --cask font-maple-mono-nf-cn  

vscode配置

字体设置前面添加 Maple Mono NF CN,系统会优先匹配该字体。

不太喜欢符号(==,===,!=...)连写,可以配置连写规则来关闭:

~/Library/Application Support/Code/User/settings.json:

...
"editor.fontFamily": "Maple Mono NF CN, Menlo, Monaco, 'Courier New', monospace",
 "editor.fontLigatures": "'calt', 'ss04', 'ss01', 'ss02'",
...

editor.fontLigatures 配置连写规则

显示效果

[TODO],[FIXME]这些关键字连写特性可以触发高亮加粗,nf字体图标也可以显示。不错不错 就先这样了

参考:

https://github.com/subframe7536/maple-font/blob/variable/source/features/README.md#ligatures

其他nf字体图标: https://www.nerdfonts.com/cheat-sheet