visual-studio-code - 有什么方法可以更改 VSCode 中仅注释代码的字体系列?

标签 visual-studio-code vscode-settings

我在用户设置中遇到过这个问题 "editor.fontFamily": "Consolas, 'Courier New', monospace",但是有没有办法只改变评论的字体?我看到人们在其他编辑器中有半草书评论,我希望能够复制类似的内容。

最佳答案

您可以使用 editor.tokenColorCustomizations 更改字体样式。环境:

"editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "scope": "comment",
            "settings": {
                "fontStyle": "italic"
            }
        }
    ]
}



我认为现在没有办法改变字体系列。该设置只允许自定义 fontStyleforeground (文字颜色)。不过,有一个开放的功能请求可以添加对它的支持:

Support fontName in textMateRules (#36512)

关于visual-studio-code - 有什么方法可以更改 VSCode 中仅注释代码的字体系列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48838578/

相关文章:

flutter - 我在 VS Code 中找不到为目标设备选择的位置。 ( flutter )

css - VSCode 为所有 mso 属性抛出错误...?

visual-studio-code - 在插入或命令模式期间更改 VSCodeVim 中的光标?

python - Visual Studio Code - 删除 pylint

visual-studio-code - 是否有一个键绑定(bind)来聚焦 VSCode 中已经打开的搜索编辑器?

exception - Dart/Flutter - 调试器在捕获到异常时停止

ide - VS Code search.exclude不起作用

angularjs - Visual Studio Code 调试中未实现的控制台 API : undefined, 错误

powershell - vs code终端每次都改成powershell

html - 如何强制使用更漂亮的 html 格式来格式化一行中的标签?