现在,它是一个模糊的灰色覆盖,这是很难看到。有办法改变默认颜色吗?
当前回答
你也可以改变选择/搜索的边界,看看下面的配置,其中包含了在这个线程中已经找到的其他值:
"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
}
其他回答
更新 参见@Jakub zawilak对VScode 1.12+的回答
旧的答案
Visual Studio Code将此选项称为高亮显示,不幸的是,我不认为颜色目前是可定制的。主题可以控制“选择”颜色,但“选择高亮”颜色是硬编码的。
请参阅此问题跟踪可能的解决方案:https://github.com/Microsoft/vscode/issues/1636
(作为旁注,您可以在编辑器中切换或关闭此功能。selectionHighlight设置。)
如果有人发现自己读了@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"
}
在右边设置窗格中的现有{}之间。
在“编辑器:令牌颜色自定义”设置中添加以下行。json文件。
"workbench.colorCustomizations": {
"editor.selectionBackground": "#135564",
"editor.selectionHighlightBackground": "#135564"
},
有关更多选项,请参阅主题颜色参考
正如我测试过的那样,设置边框颜色比设置背景颜色更容易阅读,这正是Sublime Text所做的。
例如,在settings.json中添加这些行:
"workbench.colorCustomizations": {
"editor.selectionHighlightBorder": "#FFFA",
},
选中的单词将会像这样显示:
你也可以改变选择/搜索的边界,看看下面的配置,其中包含了在这个线程中已经找到的其他值:
"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
}
推荐文章
- Visual Studio代码更改文件资源管理器托盘的字体大小?
- 如何防止Visual Studio Code总是重新打开以前的文件或文件夹?
- VSCode单引号到双引号自动替换
- 如何删除Visual Studio代码中的重复行?
- 如何设置每个文件类型的标签大小?
- 我如何添加环境变量启动。VSCode中的json
- 如何格式化Visual Studio Code项目中的所有文件?
- Pylint在Visual Studio代码中“未解决的导入”错误
- 如何在VS Code中默认打开文本换行
- 在Visual Studio代码中更改突出显示文本的颜色
- Visual studio代码-键盘快捷键-全部展开/折叠
- Visual Studio Code无法检测已安装的Git
- 禁用Visual Studio代码中的工具提示提示
- Visual Studio Code -将空格转换为制表符
- 在VSCode中的列自动硬换行