2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

修改VScode行号区的背景颜色

Last updated at Posted at 2018-02-25

vs code是相当不错的一个编辑器,现阶段我用来编写nim程序。
vs code非常丧心病狂一点就是行号区和编辑区的背景颜色都是一样,
这样会导致要看行首有没有对齐会非常吃力。这个问题让我纠结了非常久。

我第一次找到的解决方法是,通过修改workbench.main.css ,在里面定义margin-view-overlays的背景颜色。
但是会导致vscode文件提示损坏,这虽然不会影响正常使用。如果更新或者默认安装新版本的VSCODE,
workbench.main.css肯定会被覆盖掉,所以这个还不是最好的解决方法。
不过,如果你想魔改vscode, 直接去改workbench.main.css应该是个好方法。

更好的方法是在用户设置用定义加入:

    "workbench.colorCustomizations": {
        "editorLineNumber.foreground": "#17a346",
        "editorGutter.background": "#020230",
        "editorCursor.foreground": "#d41313",
    },

打开用户设置的方法是文件-首选项-设置,快捷键是ctrl + ,
这个用户设置会保存在settings.json中
完整路径是 %appdata%\Code\User\settings.json

以下是我个人设置的完整内容:

// 将设置放入此文件中以覆盖默认设置
{
    "vsicons.dontShowNewVersionMessage": true,
    "window.zoomLevel": 1,
    "workbench.activityBar.visible": true,
    "workbench.iconTheme": "vscode-icons",
    "workbench.statusBar.visible": true,
    "editor.accessibilitySupport": "on",
    "editor.renderIndentGuides": false,
    "[nim]": {},
    "editor.tabSize": 4,
    "workbench.colorCustomizations": {
        "editorLineNumber.foreground": "#17a346",
        "editorGutter.background": "#020230",
        "editorCursor.foreground": "#d41313",
    },
    "workbench.colorTheme": "Monokai",
    "terminal.integrated.cursorBlinking": true,


}

如以上设置,行号是亮绿色,行号区是暗蓝色,光标是亮红色的。

codegay 2018年2月24日 17:46:31

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?