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


当前回答

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

去>文件首选>设置 在搜索编辑器中输入令牌颜色自定义 在编辑器令牌颜色自定义标题下 单击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。前景色——这是你光标的颜色。

其他回答

在“编辑器:令牌颜色自定义”设置中添加以下行。json文件。

"workbench.colorCustomizations": {
    "editor.selectionBackground": "#135564",
    "editor.selectionHighlightBackground": "#135564"
},

有关更多选项,请参阅主题颜色参考

你也可以改变选择/搜索的边界,看看下面的配置,其中包含了在这个线程中已经找到的其他值:

"workbench.colorCustomizations": {
        "editor.selectionBackground": "#e788ff7c",
        "editor.selectionHighlightBackground": "#ff00005b",
        "editor.selectionHighlightBorder": "#fbf300e0", ##border when you select
        "editor.findMatchBackground": "#f352fe8f",
        "editor.findMatchHighlightBackground": "#8e52fe9e",
        "editor.findMatchHighlightBorder": "#fbf300e0" ##border when you search for something
        }

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

去>文件首选>设置 在搜索编辑器中输入令牌颜色自定义 在编辑器令牌颜色自定义标题下 单击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。前景色——这是你光标的颜色。

更新 参见@Jakub zawilak对VScode 1.12+的回答


旧的答案

Visual Studio Code将此选项称为高亮显示,不幸的是,我不认为颜色目前是可定制的。主题可以控制“选择”颜色,但“选择高亮”颜色是硬编码的。

请参阅此问题跟踪可能的解决方案:https://github.com/Microsoft/vscode/issues/1636

(作为旁注,您可以在编辑器中切换或关闭此功能。selectionHighlight设置。)

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

步骤

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

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

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