让你的VS Code性感起来,italic font

之前一直用WebStorm编写代码,最近转到VS Code后,对WebStorm的斜体字样式念念不忘,由于本人是个颜值控,比较喜欢好看的字体,骚气的代码配色,所以想办法让VS Code也支持斜体字和连字符特性等,

连字符特性很好解决,只需一行设置即可:

  "editor.fontLigatures": true
复制代码

前提是你设置的编辑器当前字体要支持Font Ligatures特性,比如经典的Fira Code字体,以前非常迷这款字体,但是你们懂的,任何好看的东西,久了都会没新鲜感...

后来喜欢上了Operator Mono, 非常漂亮的字体, 本文图示所用字体采用的就是这款:

这个斜体配置,需要在自定义设置中添加如下配置项:

"editor.tokenColorCustomizations": {
    "textMateRules": [
      {
        "name": "italic font",
        "scope": [
          "comment",
          "keyword",
          "storage",
          "keyword.control",
          "keyword.control.from",
          "keyword.control.flow",
          "keyword.operator.new",
          "keyword.control.import",
          "keyword.control.export",
          "keyword.control.default",
          "keyword.control.trycatch",
          "keyword.control.conditional",
          "storage.type",
          "storage.type.class",
          "storage.modifier.tsx",
          "storage.type.function",
          "storage.modifier.async",
          "variable.language",
          "variable.language.this",
          "variable.language.super",
          "meta.class",
          "meta.var.expr",
          "constant.language.null",
          "support.type.primitive",
          "entity.name.method.js",
          "entity.other.attribute-name",
          "punctuation.definition.comment",
          "text.html.basic entity.other.attribute-name",
          "tag.decorator.js entity.name.tag.js",
          "tag.decorator.js punctuation.definition.tag.js",
          "source.js constant.other.object.key.js string.unquoted.label.js",
        ],
        "settings": {
          "fontStyle": "italic",
        }
      },
    ]
  },

复制代码

以上配置,对js中的一些关键字可以完美支持italic字体,如果不满足你的要求,可以尝试自己添加配置,配置名称的查找可以通过:⇧⌘P -> inspect the scopes 来实现,具体参考VS Code官方文档

所谓萝卜白菜各有所爱,不喜勿喷,同时欢迎大家留言交流。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值