现在,它是一个模糊的灰色覆盖,这是很难看到。有办法改变默认颜色吗?


当前回答

如果有人发现自己读了@FujiRoyale的答案,而其他人都不起作用,并想知道为什么他/她的也不起作用,但由于最近想知道为什么,我遵循了他们的答案,并有(v1.18的vscode)这作为用户设置设置:

{
    // Is git enabled
    "git.enabled": true,
    // Path to the git executable
    "git.path": "C:\\Users\\t606964\\AppData\\Local\\Programs\\Git\\mingw64\\bin\\git.exe",
    "workbench.startupEditor": "newUntitledFile",
    // other settings
    //
    "editor.fontSize": 12,
    "editor.tabSize": 2,
    "git.confirmSync": false,
    "workbench.colorTheme": "Monokai",
    "editor.fontWeight": "bold",
    "editor.formatOnSave": true,
    "editor.formatOnPaste": true,
    "workbench.iconTheme": "vscode-icons",
    "explorer.confirmDelete": false,
    "files.autoSave": "off",
    "workbench.colorCustomizations": {
        "editor.lineHighlightBackground": "#f00",
        "editor.selectionBackground": "#0f0",
        "editor.wordHighlightBackground": "#00f",
        "editorCursor.foreground": "#ff0"
    }
}

请注意他们的答案中的缩进、逗号和双引号的删除(我不得不摆弄它才能得到正确的答案,这从答案中不太清楚)。应该不需要重新启动vscode,但它可能值得去>文件自动保存,看看你是否开始得到原色高亮。然后为你的高光部分选择更好的颜色。

您还可以通过粘贴在工作区设置中实现此功能

"workbench.colorCustomizations": {
    "editor.lineHighlightBackground": "#f00",
    "editor.selectionBackground": "#0f0",
    "editor.wordHighlightBackground": "#00f",
    "editorCursor.foreground": "#ff0"
}

在右边设置窗格中的现有{}之间。

其他回答

正如我测试过的那样,设置边框颜色比设置背景颜色更容易阅读,这正是Sublime Text所做的。

例如,在settings.json中添加这些行:

"workbench.colorCustomizations": {
    "editor.selectionHighlightBorder": "#FFFA",
},

选中的单词将会像这样显示:

如果有人发现这一点,像我一样,无法得到上述配置工作尝试这样做。

去>文件首选>设置 在搜索编辑器中输入令牌颜色自定义 在编辑器令牌颜色自定义标题下 单击settings.json中的edit 在右边的列中选择user Settings 将其粘贴到json对象中

确保用你想看到的颜色替换#。

"workbench.colorCustomizations": {
    "editor.lineHighlightBackground": "#<color1>",
    "editor.selectionBackground": "#<color2>",
    "editor.selectionHighlightBackground": "#<color3>",
    "editor.wordHighlightBackground": "#<color4>",
    "editorCursor.foreground": "#<color5>"
},

我对上述配置的理解。

编辑器。lineHighlightBackground -当你点击一条线时,这是线背景的颜色。

“编辑器。selectionBackground" -你用光标选择的单词的背景。

“编辑器。selectionHighlightBackground" -这是文件中其他地方选择的背景,与您用光标选择的单词相匹配。想想一个名为foo的变量,它在整个文件中都被使用。然后用光标选择一个“foo”,页面上所有其他的“foo”将是这个变量中指定的颜色。

“编辑器。wordHighlightBackground" -如果点击默认的高亮单词不生效,这是所选文本的颜色。我只看到当你点击一个没有自动选择的单词时,这个值才会有所不同。

editorCursor。前景色——这是你光标的颜色。

你试过使用/添加扩展文本标记(高光)由Ryuichi Inagaki ??

你可以选择/高亮一个选择块,右键单击Toggle highlight来给它一个独特的颜色,然后继续和重复其他选择块,给它们每个不同的颜色,这是我发现最有用的!

如果有人发现自己读了@FujiRoyale的答案,而其他人都不起作用,并想知道为什么他/她的也不起作用,但由于最近想知道为什么,我遵循了他们的答案,并有(v1.18的vscode)这作为用户设置设置:

{
    // Is git enabled
    "git.enabled": true,
    // Path to the git executable
    "git.path": "C:\\Users\\t606964\\AppData\\Local\\Programs\\Git\\mingw64\\bin\\git.exe",
    "workbench.startupEditor": "newUntitledFile",
    // other settings
    //
    "editor.fontSize": 12,
    "editor.tabSize": 2,
    "git.confirmSync": false,
    "workbench.colorTheme": "Monokai",
    "editor.fontWeight": "bold",
    "editor.formatOnSave": true,
    "editor.formatOnPaste": true,
    "workbench.iconTheme": "vscode-icons",
    "explorer.confirmDelete": false,
    "files.autoSave": "off",
    "workbench.colorCustomizations": {
        "editor.lineHighlightBackground": "#f00",
        "editor.selectionBackground": "#0f0",
        "editor.wordHighlightBackground": "#00f",
        "editorCursor.foreground": "#ff0"
    }
}

请注意他们的答案中的缩进、逗号和双引号的删除(我不得不摆弄它才能得到正确的答案,这从答案中不太清楚)。应该不需要重新启动vscode,但它可能值得去>文件自动保存,看看你是否开始得到原色高亮。然后为你的高光部分选择更好的颜色。

您还可以通过粘贴在工作区设置中实现此功能

"workbench.colorCustomizations": {
    "editor.lineHighlightBackground": "#f00",
    "editor.selectionBackground": "#0f0",
    "editor.wordHighlightBackground": "#00f",
    "editorCursor.foreground": "#ff0"
}

在右边设置窗格中的现有{}之间。

你可以用你喜欢的颜色来改变它:

步骤

开放可视代码 转到文件菜单 参数设置—>设置

打开Settings后,您将在右侧栏中更新您的设置,将此代码复制并粘贴到主括号{…}

"workbench.colorCustomizations": {
    "editor.selectionBackground": "#f00", // red hexadecimal code
    "editor.selectionHighlightBackground": "#fff" // white hex code
},