C++ 头文件字体显示全白
时间: 2023-10-22 19:05:28 浏览: 173
出现这种情况可能是因为你的编辑器或终端默认使用了白色背景,而头文件字体颜色默认设置为白色。可以尝试修改编辑器或终端的背景颜色,或者修改头文件字体颜色。如果你使用的是 Visual Studio Code 编辑器,可以在设置中搜索 "workbench.colorCustomizations" 并添加以下内容:
```
"workbench.colorCustomizations": {
"editorGutter.background": "#F8F8F8",
"editorLineNumber.foreground": "#BBBBBB",
"editor.selectionBackground": "#EFEFEF",
"editor.inactiveSelectionBackground": "#EFEFEF",
"editor.selectionHighlightBorder": "#EFEFEF",
"editor.wordHighlightBorder": "#EFEFEF",
"editor.wordHighlightStrongBorder": "#EFEFEF",
"editor.findMatchBorder": "#EFEFEF",
"editor.findMatchHighlightBorder": "#EFEFEF",
"editorBracketMatch.border": "#EFEFEF",
"editorBracketMatch.background": "#F0F0F0",
"editorBracketMatch.highlightBackground": "#F0F0F0",
"editorCodeLens.foreground": "#999999",
"editorSuggestWidget.background": "#F8F8F8",
"editorSuggestWidget.border": "#EFEFEF",
"editorSuggestWidget.selectedBackground": "#EFEFEF",
"editorOverviewRuler.border": "#F8F8F8",
"editorOverviewRuler.findMatchForeground": "#EFEFEF",
"editorOverviewRuler.rangeHighlightForeground": "#EFEFEF",
"editorOverviewRuler.selectionHighlightForeground": "#EFEFEF",
"editorOverviewRuler.wordHighlightForeground": "#EFEFEF",
"editorOverviewRuler.wordHighlightStrongForeground": "#EFEFEF",
"editorWhitespace.foreground": "#BBBBBB",
"editorIndentGuide.background": "#F8F8F8",
"editor.lineHighlightBackground": "#F8F8F8",
"editor.hoverHighlightBackground": "#F8F8F8",
"diffEditor.insertedTextBackground": "#BBFFBB",
"diffEditor.removedTextBackground": "#FFBBBB",
"editorGroupHeader.tabsBackground": "#F8F8F8",
"panel.background": "#F8F8F8",
"sideBar.background": "#F8F8F8",
"statusBar.background": "#F8F8F8",
"tab.activeBackground": "#F8F8F8",
"tab.border": "#EFEFEF",
"tab.inactiveBackground": "#F8F8F8",
"titleBar.activeBackground": "#F8F8F8",
"titleBar.inactiveBackground": "#F8F8F8"
},
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "entity.name.type.class",
"settings": {
"foreground": "#6C71C4"
}
},
{
"scope": "entity.name.function",
"settings": {
"foreground": "#268BD2"
}
},
{
"scope": "entity.other.inherited-class",
"settings": {
"foreground": "#6C71C4"
}
},
{
"scope": "variable.parameter",
"settings": {
"foreground": "#268BD2"
}
},
{
"scope": "storage.type",
"settings": {
"foreground": "#6C71C4"
}
},
{
"scope": "support.type",
"settings": {
"foreground": "#6C71C4"
}
},
{
"scope": "keyword.operator",
"settings": {
"foreground": "#DC322F"
}
},
{
"scope": "constant.numeric",
"settings": {
"foreground": "#D33682"
}
},
{
"scope": "constant.language",
"settings": {
"foreground": "#6C71C4"
}
},
{
"scope": "string",
"settings": {
"foreground": "#2AA198"
}
},
{
"scope": "comment",
"settings": {
"foreground": "#657B83"
}
}
]
}
```
其中,`editor.tokenColorCustomizations` 的部分可以修改头文件字体颜色。
阅读全文