现在,它是一个模糊的灰色覆盖,这是很难看到。有办法改变默认颜色吗?
当前回答
正如我测试过的那样,设置边框颜色比设置背景颜色更容易阅读,这正是Sublime Text所做的。
例如,在settings.json中添加这些行:
"workbench.colorCustomizations": {
"editor.selectionHighlightBorder": "#FFFA",
},
选中的单词将会像这样显示:
其他回答
正如我测试过的那样,设置边框颜色比设置背景颜色更容易阅读,这正是Sublime Text所做的。
例如,在settings.json中添加这些行:
"workbench.colorCustomizations": {
"editor.selectionHighlightBorder": "#FFFA",
},
选中的单词将会像这样显示:
你试过使用/添加扩展文本标记(高光)由Ryuichi Inagaki ??
你可以选择/高亮一个选择块,右键单击Toggle highlight来给它一个独特的颜色,然后继续和重复其他选择块,给它们每个不同的颜色,这是我发现最有用的!
你可以用你喜欢的颜色来改变它:
步骤
开放可视代码 转到文件菜单 参数设置—>设置
打开Settings后,您将在右侧栏中更新您的设置,将此代码复制并粘贴到主括号{…}
"workbench.colorCustomizations": {
"editor.selectionBackground": "#f00", // red hexadecimal code
"editor.selectionHighlightBackground": "#fff" // white hex code
},
在“编辑器:令牌颜色自定义”设置中添加以下行。json文件。
"workbench.colorCustomizations": {
"editor.selectionBackground": "#135564",
"editor.selectionHighlightBackground": "#135564"
},
有关更多选项,请参阅主题颜色参考
上述答案涵盖了与选择内容相同的已选文本和区域,但它们忽略了当前搜索匹配和其他搜索匹配——这两者都存在同样的问题。
"workbench.colorCustomizations": {
"editor.findMatchBackground": "#00cc44a8", //Current SEARCH MATCH
"editor.findMatchHighlightBackground": "#ff7b00a1" //Other SEARCH MATCHES
}
注意,当使用Change All Occurrences CtrlF2(一个超级有用的命令,智能地选择字符串的所有出现,在每个位置放置游标以进行多实例编辑)时,上述设置也会影响颜色。
更新:
对于那些使用流行扩展编号书签-你现在可以改变书签行背景颜色-使über-easy注意到他们。(你是否曾经想要在代码中临时标记行,就像在纸上用荧光笔一样?)将这一行添加到设置中。json(也在workbench.colorCustomizations下):
"numberedBookmarks.lineBackground": "#007700"
不要错过Henry Zhu的有用建议。我把亨利的提示添加到上面的设置中,发现整体效果有所改善。(亨利的建议不包括在这个答案-请点击链接阅读亨利的额外建议)
Tom Mai通过评论补充道:
确保两种颜色的编辑器。findMatchBackground和编辑器。findMatchHighlightBackground有透明度(或有一些alpha值),以便编辑器。selectionBackground和编辑器。selectionHighlightBackground通过搜索显示。这两种颜色你都可以保留,编辑。selectionBackground和编辑器。selectionHighlightBackground,在某种程度上是非透明的(没有alpha值),并且它完美地工作
一个典型的设置文件post mod的例子:
{ "git.enableSmartCommit": true, "git.autofetch": true, "breadcrumbs.enabled": true, "git.confirmSync": false, "explorer.confirmDelete": false, "code-runner.saveFileBeforeRun": true, "code-runner.saveAllFilesBeforeRun": true, "workbench.activityBar.visible": true, "files.trimTrailingWhitespace": true, "telemetry.enableTelemetry": false, "scm.providers.visible": 0, //0 allows manual resize of the Source Control panels "editor.renameOnType": true, //Added Aug 2020: renames matching HTML tags "workbench.colorCustomizations": { "editor.selectionBackground": "#e788ff7c", //Currently SELECTED text "editor.selectionHighlightBackground": "#ff00005b", //Same content as selection "editor.findMatchBackground": "#00cc44a8", //Current SEARCH MATCH "editor.findMatchHighlightBackground": "#ff7b00a1", //Other SEARCH MATCHES "numberedBookmarks.lineBackground": "#007700" //Henry's tip goes here... (don't forget to add comma to line above) } }
在哪里找到设置。json文件:
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
ALTERNATE方法打开设置。json文件:
按Ctrl +,(逗号)打开设置 工作台 设置编辑器 在顶部的搜索框中,粘贴workbench.colorCustomizations 在左侧,单击Workbench,然后单击Appearance 单击右边的链接:在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
推荐文章
- 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中的列自动硬换行