[英]How do i setup font ligatures for Visual Studio Code?
我正在使用这两行为我的 VSCode 设置字体连字。
"editor.fontFamily": "'Fira Code'",
"editor.fontLigatures": true,
但它看起来仍然和以前一样。
我试图禁用所有已安装的扩展程序,但没有奏效。
这是我的完整设置:
{
"workbench.iconTheme": "material-icon-theme",
"workbench.colorTheme": "Material Theme Darker High Contrast",
"editor.formatOnSave": true,
"explorer.confirmDelete": false,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"window.zoomLevel": 0,
"editor.fontSize": 16, //!=
"editor.fontFamily": "'Fira Code'",
"editor.fontLigatures": true,
"explorer.confirmDragAndDrop": false
}
我想要功能齐全的字体连字,如本页所示:我希望它看起来如何。 相反,我得到了一些字体的基本文本。
第 1 步:安装Fira 代码。
第 2 步:在 VSCode 设置中设置字体:
"editor.fontFamily": "Fira Code, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
第 3 步:重新启动/重新加载 VSCode。
就是这样。
您的 PC 中似乎没有安装 Fira 字体。 如果您使用的是 MacOS,请按照此步骤操作。
打开终端并运行这些命令。
brew tap homebrew/cask-fonts
brew cask install font-fira-code
并尝试重新启动 VsCode。
或者,如果您使用的是其他操作系统(Windows 或 Linux),请按照此步骤操作。 https://github.com/tonsky/FiraCode/wiki/Installing
希望这可能会有所帮助。
从 VS Code 1.40 开始, editor.fontLigatrues
支持字符串设置,这对于支持不同风格集的字体很有用:
IE:
"editor.fontLigatures": "'ss09', 'zero', 'onum'",
"editor.fontLigatures": "'ss01'",
您可以在此处阅读有关功能标签的更多信息(但支持取决于相关字体):
https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags
如果您使用的是 macOS,有时您需要重新启动计算机才能使 Visual Studio Code 的连字生效。
我解决了我的问题,把 Fira 代码放在没有“”的地方
对于使用不同版本 VS Code 的用户,您可以尝试按 control 和逗号的组合键( Ctrl + , )打开设置选项卡,然后在搜索字体连字后
在此之后单击settings.json 中的编辑。
然后设置editor.fontLigatures=true
。
完成此步骤后,您就可以开始了。
为 Mac“计算机”而不是“用户”安装 FiraCode 字体系列
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.