参考:白月黑羽的python教程网站
不太习惯Dark主题,然而又没有找到合适的Light Theme
IDLE Shell的高亮倒是不错,可是VScode 的插件里没搜到
上网搜索,感谢B站up白月黑羽的分享,
最终使用[Atom One Light]主题,添加自定义高亮,虽然没有完全如idle高亮
但是改了一些字体颜色后,清晰多了
示例:
操作记录:
设置——工作区——外观——编辑 json 添加代码
指定类型的代码高亮设置:
添加自定义代码:
{ //自定义 数字常量 "scope": [ "constant.numeric" //注意要有"" ], "settings": { "foreground": "#ebb82c", "fontStyle": "bold" } }, //间隔有逗号
|
[Atom One Light]主题的基础上自定义全部代码:
{
"workbench.colorCustomizations": {
"[Atom One Light]": {
// activity bar
"activityBar.border": "#e9e1e1",
"activityBar.background": "#104057",
"activityBar.foreground": "#dd447e",
"activityBar.inactiveForeground": "#6cb8db",
"activityBarBadge.background": "#d73a49",
// sideBar bar
"sideBar.border": "#e7e4e4",
"sideBar.background": "#ffffff",
"sideBar.foreground": "#000000",
"sideBarSectionHeader.background": "#ffffff",
"sideBarSectionHeader.border": "#e1e1e6",
// others
"editorLineNumber.foreground": "#4d5f3c",
"editorIndentGuide.background": "#e0d6d6",
"editorIndentGuide.activeBackground": "#ddbebe",
}
},
"editor.tokenColorCustomizations": {
"[Atom One Light]": {
"comments" : {
"foreground": "#11c4cadc",
"fontStyle": "bold"
}, //注释
"numbers": {
"foreground": "#264666", //数字
"fontStyle": "bold"
},
"textMateRules": [
{ //自定义 数字常量
"scope":
[
"constant.numeric" //注意要有""
],
"settings":
{
"foreground": "#ebb82c",
"fontStyle": "bold"
}
}, //间隔有逗号
{ //自定义 source.python variable.parameter
"scope":
[
"source.python variable.parameter" //
],
"settings":
{
"foreground": "#eb2c45",
"fontStyle": "bold"
}
},
{ //自定义 keyword.operator
"scope":
[
"keyword.operator" //
],
"settings":
{
"foreground": "#ec9e0dc4",
"fontStyle": "bold"
}
},
{ //自定义 //source.python constant.other
"scope":
[
"source.python constant.other" //
],
"settings":
{
"foreground": "#50A14F",
"fontStyle": "bold"
}
},
{ //自定义 string
"scope":
[
"string" //
],
"settings":
{
"foreground": "#0d9c0dde",
"fontStyle": "bold"
}
},
]
}
}
}
更多推荐
Search:Vscode 如何自定义Python代码高亮
发布评论