Visual Studio Code默认的状态栏颜色是蓝色,我觉得很分散注意力。我使用了这个扩展程序来改变颜色,但在版本1.10.2更新后它停止工作了。
您可以通过编辑用户设置并添加以下代码行来更改状态栏的颜色:
"workbench.colorCustomizations": {
"statusBar.background" : "#1A1A1A",
"statusBar.noFolderBackground" : "#212121",
"statusBar.debuggingBackground": "#263238"
}
const config2 = vscode.workspace.getConfiguration('workbench.colorCustomizations.statusBar');
config2.update('background', '#1A1A1A');
似乎没有任何作用? - TomObject.assign(vscode.workspace.getConfiguration('workbench.colorCustomizations'), { "statusBar.background" : "#00FF00"})
会给我一个 TypeError,告诉我我们不能分配到只读属性。所以我猜使用 getConfiguration 方法并不是正确的方法。 - acesmndr "workbench.colorCustomizations": {
"[Markdown Editor Dark]": {
"statusBar.background" : "#1A1A1A",
"statusBar.noFolderBackground" : "#212121",
"statusBar.debuggingBackground": "#263238"
}
},
- Walton我将会为像我这样的新手省下30分钟的时间 - 这需要在 settings.json 文件中进行编辑。最简单的访问方式是通过菜单命令 文件 → 首选项 → 设置,搜索“Color”,选择选项“工作台:颜色自定义” → “在 settings.json 中编辑”。
这使用了Gama11提出的解决方案,但注意:
在settings.json文件中代码的最终形式应该像这样 - 注意双重大括号包围“workbench.colorCustomizations”:
{
// fontSize just for testing purposes, commented out.
//"editor.fontSize" : 12
// StatusBar color:
"workbench.colorCustomizations": {
"statusBar.background" : "#303030",
"statusBar.noFolderBackground" : "#222225",
"statusBar.debuggingBackground": "#511f1f"
}
}
复制/粘贴上述代码后,按下Ctrl+S保存更改至"settings.json"。
本解决方案改编自状态栏颜色。
由于每个主题都非常不同,您可能不希望在全局范围内进行此类更改。相反,请基于每个主题指定它们,例如:
"workbench.colorCustomizations": {
"[Some Theme Name]": {
"statusBar.background" : "#486357",
"statusBar.foreground" : "#c8e9c5",
},
"[Some Other Theme Name]": {
"statusBar.background" : "#385357",
"statusBar.foreground" : "#d7e9c4",
}
},
这样当您在喜爱的主题之间切换时,它们的自定义内容将不会被遗忘,并且将在该上下文中有意义。
titleBar.activeBackground
和 titleBar.activeForeground
,使其更加明显。 - QwertystatusBar.noFolderBackground
和 statusBar.debuggingBackground
,否则它们不会受到影响。 - lapis{
"folders": [],
"settings": {
"workbench.colorCustomizations": {
"statusBar.background": "#938e04",
"statusBar.foreground": "#ffffff"
}
}
}
{
"workbench.colorCustomizations": {
"statusBar.background": "#938e04",
"statusBar.foreground": "#ffffff"
}
}
在我的看法中,有一个比前面提到的更强大、更健壮的解决方案,那就是根据你正在处理的文件改变状态栏的颜色——它叫做ColorTabs,它允许你提供一系列正则表达式,并基于此改变颜色。
声明——我是这个扩展的作者。
.vscode
文件夹中,文件名为 settings.json
。{
"workbench.colorCustomizations": {
"statusBar.background": "#7c0101",
"statusBar.foreground": "#ffffff"
}
}
您可以通过编辑扩展来更改颜色:
"colors":{
"statusBar.background": "#505050",
},
如果您正在使用Vim插件, 改变状态栏颜色的最佳方法是进入设置, 搜索 "status bar color" 并勾选 "允许 Visual Studio Code 根据模式改变颜色"
以下是Vim插件状态颜色控制的快照:
Visual Studio 1.75(2023年1月)将提供一个新选项,来源于问题155294:
我正在成为我们调试器的高级用户(是的,终于)。
这意味着在大多数“VS Code时间”中,我都在运行或连接某种类型的调试程序。因此,我经常看到丑陋的橙色调试状态栏处理。
我不喜欢它,对我来说,只看到activitybar
图标装饰就足够了。
现在有一个专门的设置(PR 168513),而不是在workbench.colorCustomizations
中设置statusBar.debuggingBackground
:
debug.enableStatusBarColor
:当调试器处于活动状态时,颜色状态栏
这在VSCode内部人员今天可用。
这也在Mark的“{{link1:如何防止Visual Studio Code在运行任何Java文件时更改状态栏颜色为橙色}”中提到。
debug.enableStatusBarColor
设置为false
。 - Mark