现在,它是一个微弱的灰色覆盖层,很难看到.有什么方法可以改变默认颜色?
"workbench.colorCustomizations": { "editor.selectionBackground": "#135564", "editor.selectionHighlightBackground": "#135564" },
有关更多选项,请参阅主题颜色参考
上面的答案涵盖了Selected text
和areas with same content as selection
,但是错过了Current Search Match
和Other Search Matches
- 具有同样的问题。
"workbench.colorCustomizations": { "editor.findMatchBackground": "#00cc44a8", //Current SEARCH MATCH "editor.findMatchHighlightBackground": "#ff7b00a1" //Other SEARCH MATCHES }
请注意,在使用“更改所有出现次数” CtrlF2 (一个超级有用的命令,它会 智能地 选择所有出现的字符串,将光标置于每个位置进行多实例编辑)时,上述设置也会影响颜色。
{ “ git.enableSmartCommit”:是的, “ git.autofetch”:是的, “ breadcrumbs.enabled”:是的, “ git.confirmSync”:否, “ explorer.confirmDelete”:否, “ code-runner.saveFileBeforeRun”:是, “ code-runner.saveAllFilesBeforeRun”:是, “ workbench.activityBar.visible”:是, “ files.trimTrailingWhitespace”:是的, “ telemetry.enableTelemetry”:否, “ scm.providers.visible”:0,// 0允许手动调整源代码控制面板的大小 “ workbench.colorCustomizations”:{ “ editor.selectionBackground”:“#e788ff7c”,//当前选择的文本 “ editor.selectionHighlightBackground”:“#ff00005b”,//内容与选择相同 “ editor.findMatchBackground”:“#00cc44a8”,//当前的搜索匹配 “ editor.findMatchHighlightBackground”:“#ff7b00a1” //其他搜索匹配 } }
Depending on your platform, the user settings file is located here: Windows %APPDATA%\Code\User\settings.json macOS $HOME/Library/Application Support/Code/User/settings.json Linux $HOME/.config/Code/User/settings.json
Ctrl +,(逗号)打开“设置”
工作台
设定编辑器
在顶部的搜索框中,粘贴 workbench.colorCustomizations
在左侧,单击Workbench
,然后Appearance
单击右侧的链接: Edit in settings.json
参考文献:
https://code.visualstudio.com/api/references/theme-color#editor-colors
https://code.visualstudio.com/docs/getstarted/themes#_customize-a-color-theme
https://code.visualstudio.com/docs/getstarted/settings
If anyone finds this and, like me, was unable to get the above config working try doing this.
go to file > Preferences > settings
type in the search Editor token color customizations
under the Editor token color customizations header
click on edit in settings.json
on the right hand column select user settings
paste this into the json object
Be sure to replace the #'s with colors you want to see.
"workbench.colorCustomizations": { "editor.lineHighlightBackground": "#", "editor.selectionBackground": "# ", "editor.wordHighlightBackground": "# ", "editorCursor.foreground": "# " },
My understanding of the above config.
editor.lineHighlightBackground - when you click on a line this is the color the line background will be.
"editor.selectionBackground" - This is the background of matched selections elsewhere in the buffer. Think of a variable named foo and it's used all over a file. You then highlight that text and all the other foos on the page will be this color.
"editor.wordHighlightBackground" - This is the color of selected text if the default highlight word on click does not take effect. I've only seen this value make a difference if you click on a word that does not auto-select.
editorCursor.foreground - this is the color of your cursor.
更新 请参阅@JakubZawiślak对VScode 1.12+的回答
老答案
Visual Studio Code调用此选项突出显示,不幸的是,我认为当前颜色不可定制.主题可以控制"选择"颜色,但"选择突出显示"颜色是硬编码的.
请参阅此问题,跟踪可能的解决方案:https://github.com/Microsoft/vscode/issues/1636
(作为旁注,您可以使用editor.selectionHighlight
设置切换此功能或/关闭.)
正如我测试过的那样,设置边框颜色比设置背景颜色更容易阅读,这是Sublime Text的作用。
例如,将这些行添加到settings.json
:
"workbench.colorCustomizations": { "editor.selectionHighlightBorder": "#FFFA", },
所选单词将显示为: