我已经找到了一个解决方案。
https://github.com/Microsoft/vscode/issues/33607#issuecomment-424193133
/Users/(你的用户名)/.vscode.css
并粘贴以下内容:.title.show-file-icons { display: none !important; }
"vscode_custom_css.imports": ["file:///Users/(你的用户名)/.vscode.css"]
CMD + Shift + P
,输入“Enable custom css and js”这将隐藏顶部栏。
.fullscreen .title.show-file-icons {display: none !important;}
。 - Nils Lindemann使用命令面板隐藏顶部栏:
安装 multi-command, Settings Cycler, Customize UI 扩展。
将以下内容添加到您的 settings.json 文件中:
"zenMode.restore": true,
"multiCommand.commands": [
{
"command": "toggleUltraZen",
"sequence": [
"workbench.action.toggleZenMode",
"settings.cycle.ultraZen",
"workbench.action.reloadWindow",
]
},
],
"settings.cycle": [{
"id": "ultraZen",
"overrideWorkspaceSettings": false,
"values": [
{
"customizeUI.stylesheet": {}
},
{
"customizeUI.stylesheet": {
".title.show-file-icons": "display: none !important;",
},
}
]
}
],
要使用此功能,请从命令面板中执行以下步骤:
多命令:执行多个命令
toggleUltraZen
并按 Enter 键请注意,第一个命令将重新加载窗口。
我还使用以下内容(用于编码):
"zenMode.fullScreen": false,
"zenMode.centerLayout": false,
"zenMode.hideLineNumbers": false,
"zenMode.hideStatusBar": false,
你可以根据自己的需求选择(它们可以从设置界面访问)。
以下是可以改善ZEN模式的方法。
(在底部仍然有一个区域会在滚动时覆盖代码。不幸的是,我无法使用CSS修复它(至少对我来说),因为编辑器的高度是通过JavaScript动态计算的。可能可以使用像Monkey Patch这样的扩展来解决,但我没有测试过。)
首先,从这些标准设置中选择要放入settings.json中的设置。某些设置需要重新启动,例如editor.scrollbar
设置。某些设置也会影响非ZEN模式下的显示。
{
"breadcrumbs.enabled": false,
"editor.codeLens": false,
"editor.folding": false,
"editor.foldingHighlight": false,
"editor.highlightActiveIndentGuide": false,
"editor.lineNumbers": "off",
"editor.matchBrackets": "never",
"editor.minimap.enabled": false,
"editor.minimap.renderCharacters": false,
"editor.minimap.showSlider": "always",
"editor.occurrencesHighlight": false,
"editor.overviewRulerBorder": false,
"editor.renderIndentGuides": false,
"editor.renderLineHighlight": "none",
"editor.rulers": [],
"editor.scrollbar.horizontal": "hidden",
"editor.scrollbar.vertical": "hidden",
"editor.smoothScrolling": true,
"editor.selectionHighlight": false,
"scm.diffDecorations": "none",
"window.title": "${activeEditorLong} ${dirty}",
"window.titleSeparator": " – ",
"window.zoomLevel": 1.3,
"workbench.colorCustomizations": {
// see https://code.visualstudio.com/api/references/theme-color
},
"workbench.editor.showTabs": false,
"zenMode.centerLayout": true,
"zenMode.fullScreen": true,
"zenMode.hideLineNumbers": true,
"zenMode.hideStatusBar": true,
"zenMode.hideTabs": true,
"zenMode.restore": false,
}
workbench.desktop.main.css
中。该文件通常位于 C:\Users\<username>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench
。如果没有找到,请使用 帮助 → 切换开发人员工具 找出它的位置,或者 搜索系统范围 查找它。.fullscreen .decorationsOverviewRuler {
display:none !important;
}
.fullscreen .invisible.scrollbar.vertical {
display:none !important;
}
/* You dont need this if you have "zenMode.centerLayout": false, */
.fullscreen .monaco-split-view2.separator-border>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before {
background:transparent !important;
}
/* Do not use these if you have "zenMode.hideTabs": false, */
.fullscreen .title.show-file-icons {
display: none !important;
}
.fullscreen .editor-container {
margin-top:34px !important;
}
.fullscreen .scroll-decoration {
display:none !important;
}
我通过使用 帮助 → 切换开发者工具 检查源代码找到了这些调整。
之前/之后的截图: