最近经常用keil5,字很小背景反光很强,眼睛都要瞎了,于是突发奇想,能不能把keil5背景改成护眼的绿色,结果效果还蛮不错的
![](https://i-blog.csdnimg.cn/blog_migrate/6e9cc717fb1552496a30e0fff2818efe.png)
顺便搞了一款葛巾紫的高级感配色
![](https://i-blog.csdnimg.cn/blog_migrate/e87e39e7bb4a06fe663d5412bb2a8a89.png)
具体更改方法有两个,第一个方法是打开keil5的UV4文件夹,将global.prop文件以文本形式打开(如下图),再将下面代码复制进去,替换掉原代码。
![](https://i-blog.csdnimg.cn/blog_migrate/73ea29322948bd55c4eeaf30e09a19f5.png)
一、电脑管家护眼绿色代码:
# properties for all file types
indent.automatic=1
virtual.space=0
view.whitespace=0
view.endofline=0
code.page=936
caretline.visible=1
highlight.matchingbraces=1
print.syntax.coloring=1
use.tab.color=1
create.backup.files=0
auto.load.ext.modfiles=0
save.prj.before.dbg=0
save.files.before.dbg=0
function.scanner.project=1
function.scanner.files=1
function.scanner.modules=1
# properties for c/cpp files
syntax.colouring.cpp=1
use.tab.cpp=0
tabsize.cpp=4
line.margin.visible.cpp=1
fold.cpp=1
monospaced.font.cpp=1
# properties for asm files
syntax.colouring.asm=1
use.tab.asm=0
tabsize.asm=4
line.margin.visible.asm=1
monospaced.font.asm=1
# properties for other files
use.tabs=0
tabsize=4
line.margin.visible.txt=0
monospaced.font.txt=1
# setting for code completion, syntax check and source browser information
cc.autolist=1
cc.highlightsyntax=1
cc.showparameters=1
cc.triggerlist=1
cc.triggernumchars=3
cc.enter.as.fillup=0
cc.usealpha4inactcode=1
cc.alphavalue=50
cc.autoupdbi=1
cc.updbiinterval=3
# autosave for editor files
autosave=0
autosave.interval=5
# vertical edge at right margin
edge.mode=0
edge.column=80
# Specification for text selection and caret line
selection.fore=#000000
selection.back=#86C7F7
caret.fore=#000000
caret.back=#EAEAEF
# Color for vertical edge
edge.colour=#66FAFA
# C/C++ Editor files
template.cpp="#define","#define |";"#if","#if |\r\n\r\n#endif";\\
"#include","#include ";"Header","// Header:\r\n// File Name: |\r\n// Author:\r\n// Date:\r\n";\\
"continue","continue;";"do","do\r\n{\r\n\t// TODO: enter the block content here\r\n\t\r\n\t|\r\n} while ();\r\n";\\
"enum","enum |\r\n{\r\n\t\r\n};\r\n";"for","for(|;;)\r\n{\r\n}";\\
"fpointer_type","typedef int (* |F)();\r\n";"function","void function(|)\r\n{\r\n\r\n}\r\n";\\
"if","if (|)";"ifelse","if (|)\r\n{\r\n}\r\nelse\r\n{\r\n}";\\
"struct","struct | \r\n{\r\n\r\n};\r\n";"switch","switch (|)\r\n{\r\n\tcase:\r\n\t\tbreak;\r\n\tcase:\r\n\t\tbreak;\r\n\tdefault:\r\n\t\tbreak;\r\n}";\\
"void","void | ();\r\n";"while","while (|)\r\n{\r\n}";\\
font.monospace.cpp=@黑体
font.acpmonofontname.cpp=@
font.acppropfontname.cpp=@
style.cpp.32=font:@黑体,size:15,fore:#000000,back:#CCE8CF
style.cpp.4=font:@黑体,size:15,fore:#008000,back:#CCE8CF
style.cpp.10=font:@黑体,size:15,fore:#000000,back:#CCE8CF
style.cpp.1=font:@黑体,size:15,fore:#007F00,back:#CCE8CF
style.cpp.2=font:@黑体,size:15,fore:#007F00,back:#CCE8CF
style.cpp.5=font:@黑体,size:15,fore:#0000FF,back:#CCE8CF
style.cpp.6=font:@黑体,size:15,fore:#7F007F,back:#CCE8CF
style.cpp.11=font:@黑体,size:15,fore:#000000,back:#CCE8CF
style.cpp.9=font:@黑体,size:15,fore:#7F7F00,back:#CCE8CF
style.cpp.7=font:@黑体,size:15,fore:#7F007F,back:#CCE8CF
style.cpp.34=font:@黑体,size:15,fore:#500000,back:#CCE8CF
style.cpp.35=font:@黑体,size:15,fore:#FF0000,back:#CCE8CF
style.cpp.16=font:@黑体,size:15,fore:#B00040,back:#CCE8CF
style.cpp.12=font:@黑体,size:15,fore:#000000,back:#CCE8CF
style.cpp.86=font:@黑体,size:15,fore:#696969,back:#FFFFFF
# Asm Editor files
font.monospace.asm=Courier New
style.asm.32=font:Courier New,size:10,fore:#000000,back:#FFFFFF
style.asm.1=font:Courier New,size:10,fore:#616161,back:#FFFFFF
style.asm.2=font:Courier New,size:10,fore:#FF0000,back:#FFFFFF
style.asm.3=font:Courier New,size:10,fore:#7F007F,back:#FFFFFF
style.asm.4=font:Courier New,size:10,fore:#000000,back:#FFFFFF
style.asm.5=font:Courier New,size:10,fore:#000000,back:#FFFFFF
style.asm.6=font:Courier New,size:10,fore:#0000FF,back:#FFFFFF
style.asm.7=font:Courier New,size:10,fore:#0000FF,back:#FFFFFF
style.asm.9=font:Courier New,size:10,fore:#0000FF,back:#FFFFFF
style.asm.10=font:Courier New,size:10,fore:#0000FF,back:#FFFFFF
style.asm.11=font:Courier New,size:10,fore:#007F00,back:#FFFFFF
style.asm.12=font:Courier New,size:10,fore:#7F007F,back:#FFFFFF
style.asm.8=font:Courier New,size:10,fore:#46AA03,back:#FFFFFF
# Editor Text files
font.monospace.txt=Consolas
style.txt.32=font:Verdana,size:10,fore:#000000,back:#FFFFFF
二、葛巾紫高级感配色:
# properties for all file types
indent.automatic=1
virtual.space=0
view.whitespace=0
view.endofline=0
code.page=936
caretline.visible=1
highlight.matchingbraces=1
print.syntax.coloring=1
use.tab.color=1
create.backup.files=0
auto.load.ext.modfiles=0
save.prj.before.dbg=0
save.files.before.dbg=0
function.scanner.project=1
function.scanner.files=1
function.scanner.modules=1
# properties for c/cpp files
syntax.colouring.cpp=1
use.tab.cpp=0
tabsize.cpp=4
line.margin.visible.cpp=1
fold.cpp=1
monospaced.font.cpp=1
# properties for asm files
syntax.colouring.asm=1
use.tab.asm=0
tabsize.asm=4
line.margin.visible.asm=1
monospaced.font.asm=1
# properties for other files
use.tabs=0
tabsize=4
line.margin.visible.txt=0
monospaced.font.txt=1
# setting for code completion, syntax check and source browser information
cc.autolist=1
cc.highlightsyntax=1
cc.showparameters=1
cc.triggerlist=1
cc.triggernumchars=3
cc.enter.as.fillup=0
cc.usealpha4inactcode=1
cc.alphavalue=50
cc.autoupdbi=1
cc.updbiinterval=3
# autosave for editor files
autosave=0
autosave.interval=5
# vertical edge at right margin
edge.mode=0
edge.column=80
# Specification for text selection and caret line
selection.fore=#000000
selection.back=#86C7F7
caret.fore=#000000
caret.back=#FAF9DE
# Color for vertical edge
edge.colour=#66FAFA
# C/C++ Editor files
template.cpp="#define","#define |";"#if","#if |\r\n\r\n#endif";\\
"#include","#include ";"Header","// Header:\r\n// File Name: |\r\n// Author:\r\n// Date:\r\n";\\
"continue","continue;";"do","do\r\n{\r\n\t// TODO: enter the block content here\r\n\t\r\n\t|\r\n} while ();\r\n";\\
"enum","enum |\r\n{\r\n\t\r\n};\r\n";"for","for(|;;)\r\n{\r\n}";\\
"fpointer_type","typedef int (* |F)();\r\n";"function","void function(|)\r\n{\r\n\r\n}\r\n";\\
"if","if (|)";"ifelse","if (|)\r\n{\r\n}\r\nelse\r\n{\r\n}";\\
"struct","struct | \r\n{\r\n\r\n};\r\n";"switch","switch (|)\r\n{\r\n\tcase:\r\n\t\tbreak;\r\n\tcase:\r\n\t\tbreak;\r\n\tdefault:\r\n\t\tbreak;\r\n}";\\
"void","void | ();\r\n";"while","while (|)\r\n{\r\n}";\\
font.monospace.cpp=@黑体
font.acpmonofontname.cpp=@
font.acppropfontname.cpp=@
style.cpp.32=font:@黑体,size:15,fore:#000000,back:#E9EBFE
style.cpp.4=font:@黑体,size:15,fore:#008000,back:#E9EBFE
style.cpp.10=font:@黑体,size:15,fore:#000000,back:#E9EBFE
style.cpp.1=font:@黑体,size:15,fore:#007F00,back:#E9EBFE
style.cpp.2=font:@黑体,size:15,fore:#007F00,back:#E9EBFE
style.cpp.5=font:@黑体,size:15,fore:#0000FF,back:#E9EBFE
style.cpp.6=font:@黑体,size:15,fore:#7F007F,back:#E9EBFE
style.cpp.11=font:@黑体,size:15,fore:#000000,back:#E9EBFE
style.cpp.9=font:@黑体,size:15,fore:#7F7F00,back:#E9EBFE
style.cpp.7=font:@黑体,size:15,fore:#7F007F,back:#E9EBFE
style.cpp.34=font:@黑体,size:15,fore:#500000,back:#E9EBFE
style.cpp.35=font:@黑体,size:15,fore:#FF0000,back:#E9EBFE
style.cpp.16=font:@黑体,size:15,fore:#B00040,back:#E9EBFE
style.cpp.12=font:@黑体,size:15,fore:#000000,back:#E9EBFE
style.cpp.86=font:@黑体,size:15,fore:#696969,back:#FFFFFF
# Asm Editor files
font.monospace.asm=Courier New
style.asm.32=font:Courier New,size:10,fore:#000000,back:#FFFFFF
style.asm.1=font:Courier New,size:10,fore:#616161,back:#FFFFFF
style.asm.2=font:Courier New,size:10,fore:#FF0000,back:#FFFFFF
style.asm.3=font:Courier New,size:10,fore:#7F007F,back:#FFFFFF
style.asm.4=font:Courier New,size:10,fore:#000000,back:#FFFFFF
style.asm.5=font:Courier New,size:10,fore:#000000,back:#FFFFFF
style.asm.6=font:Courier New,size:10,fore:#0000FF,back:#FFFFFF
style.asm.7=font:Courier New,size:10,fore:#0000FF,back:#FFFFFF
style.asm.9=font:Courier New,size:10,fore:#0000FF,back:#FFFFFF
style.asm.10=font:Courier New,size:10,fore:#0000FF,back:#FFFFFF
style.asm.11=font:Courier New,size:10,fore:#007F00,back:#FFFFFF
style.asm.12=font:Courier New,size:10,fore:#7F007F,back:#FFFFFF
style.asm.8=font:Courier New,size:10,fore:#46AA03,back:#FFFFFF
# Editor Text files
font.monospace.txt=Consolas
style.txt.32=font:Verdana,size:10,fore:#000000,back:#FFFFFF
三、原款白色背景(原主题)
# properties for all file types
indent.automatic=1
virtual.space=0
view.whitespace=0
view.endofline=0
code.page=936
caretline.visible=1
highlight.matchingbraces=1
print.syntax.coloring=1
use.tab.color=1
create.backup.files=0
auto.load.ext.modfiles=0
save.prj.before.dbg=0
save.files.before.dbg=0
function.scanner.project=1
function.scanner.files=1
function.scanner.modules=1
# properties for c/cpp files
syntax.colouring.cpp=1
use.tab.cpp=0
tabsize.cpp=4
line.margin.visible.cpp=1
fold.cpp=1
monospaced.font.cpp=1
# properties for asm files
syntax.colouring.asm=1
use.tab.asm=0
tabsize.asm=4
line.margin.visible.asm=1
monospaced.font.asm=1
# properties for other files
use.tabs=0
tabsize=4
line.margin.visible.txt=0
monospaced.font.txt=1
# setting for code completion and syntax check
cc.autolist=1
cc.highlightsyntax=1
cc.showparameters=1
cc.triggerlist=1
cc.triggernumchars=3
cc.enter.as.fillup=0
cc.usealpha4inactcode=1
cc.alphavalue=50
# autosave for editor files
autosave=0
autosave.interval=5
# vertical edge at right margin
edge.mode=0
edge.column=80
# Specification for text selection and caret line
selection.fore=#000000
selection.back=#86C7F7
caret.fore=#000000
caret.back=#DEFEE6
# Color for vertical edge
edge.colour=#66FAFA
# C/C++ Editor files
template.cpp="#define","#define |";"#if","#if |\r\n\r\n#endif";\\
"#include","#include ";"Header","// Header:\r\n// File Name: |\r\n// Author:\r\n// Date:\r\n";\\
"continue","continue;";"do","do\r\n{\r\n\t// TODO: enter the block content here\r\n\t\r\n\t|\r\n} while ();\r\n";\\
"enum","enum |\r\n{\r\n\t\r\n};\r\n";"for","for(|;;)\r\n{\r\n}";\\
"fpointer_type","typedef int (* |F)();\r\n";"function","void function(|)\r\n{\r\n\r\n}\r\n";\\
"if","if (|)";"ifelse","if (|)\r\n{\r\n}\r\nelse\r\n{\r\n}";\\
"struct","struct | \r\n{\r\n\r\n};\r\n";"switch","switch (|)\r\n{\r\n\tcase:\r\n\t\tbreak;\r\n\tcase:\r\n\t\tbreak;\r\n\tdefault:\r\n\t\tbreak;\r\n}";\\
"void","void | ();\r\n";"while","while (|)\r\n{\r\n}";\\
font.monospace.cpp=Courier New
style.cpp.32=font:Courier New,size:10,fore:#000000,back:#FFFFFF
style.cpp.4=font:Courier New,size:10,fore:#008000,back:#FFFFFF
style.cpp.10=font:Courier New,size:10,fore:#000000,back:#FFFFFF
style.cpp.1=font:Courier New,size:10,fore:#007F00,back:#FFFFFF
style.cpp.2=font:Courier New,size:10,fore:#007F00,back:#FFFFFF
style.cpp.5=font:Courier New,size:10,fore:#0000FF,back:#FFFFFF
style.cpp.6=font:Courier New,size:10,fore:#7F007F,back:#FFFFFF
style.cpp.11=font:Courier New,size:10,fore:#000000,back:#FFFFFF
style.cpp.9=font:Courier New,size:10,fore:#7F7F00,back:#FFFFFF
style.cpp.7=font:Courier New,size:10,fore:#7F007F,back:#FFFFFF
style.cpp.34=font:Courier New,size:10,fore:#500000,back:#20FFFF
style.cpp.35=font:Courier New,size:10,fore:#FF0000,back:#FFFFFF
style.cpp.16=font:Courier New,size:10,fore:#B00040,back:#FFFFFF
style.cpp.12=font:Courier New,size:10,fore:#000000,back:#E0C0E0
style.cpp.86=font:Courier New,size:10,fore:#696969,back:#FFFFFF
# Asm Editor files
font.monospace.asm=Courier New
style.asm.32=font:Courier New,size:10,fore:#000000,back:#FFFFFF
style.asm.1=font:Courier New,size:10,fore:#616161,back:#FFFFFF
style.asm.2=font:Courier New,size:10,fore:#FF0000,back:#FFFFFF
style.asm.3=font:Courier New,size:10,fore:#7F007F,back:#FFFFFF
style.asm.4=font:Courier New,size:10,fore:#000000,back:#FFFFFF
style.asm.5=font:Courier New,size:10,fore:#000000,back:#FFFFFF
style.asm.6=font:Courier New,size:10,fore:#0000FF,back:#FFFFFF
style.asm.7=font:Courier New,size:10,fore:#0000FF,back:#FFFFFF
style.asm.9=font:Courier New,size:10,fore:#0000FF,back:#FFFFFF
style.asm.10=font:Courier New,size:10,fore:#0000FF,back:#FFFFFF
style.asm.11=font:Courier New,size:10,fore:#007F00,back:#FFFFFF
style.asm.12=font:Courier New,size:10,fore:#7F007F,back:#FFFFFF
style.asm.8=font:Courier New,size:10,fore:#46AA03,back:#FFFFFF
# Editor Text files
font.monospace.txt=Consolas
style.txt.32=font:Verdana,size:10,fore:#000000,back:#FFFFFF
第二个方法比较麻烦,就是点开上方工具栏的小扳手,在color&fons里的c/c++ Editer files把右栏所有选项的Background换成想要的背景色。这里,给大家一张参考图,具体的RGB配色大家可以参照这图里的来配
![](https://i-blog.csdnimg.cn/blog_migrate/9e5ccfc47d741f175f2666ddd6ffceb5.png)
再者就是keil5好用插件的推荐了,可以试试下面这款插件,能实现一键打出注释模版的功能。插件百度网盘链接:
https://pan.baidu.com/s/1XIYWjekZpUKV2cDAgU02QQ
提取码: c2k5
![](https://i-blog.csdnimg.cn/blog_migrate/64f7ae5acb27567c90be265404d93fd1.png)
将插件tools解压到keil5文件夹里,重启keil5,点开tools里的customize tools menu,将插件里的文件添加到里面,操作如下所示
![](https://i-blog.csdnimg.cn/blog_migrate/f6a7ae73cc18a3bd0d8e1af026b8ed5d.png)
![](https://i-blog.csdnimg.cn/blog_migrate/f49268813b967aa8f84ae2271d13276e.png)
![](https://i-blog.csdnimg.cn/blog_migrate/0321ce079d8cdfa5f75c85e28f679fb5.png)
![](https://i-blog.csdnimg.cn/blog_migrate/60bac2c6cb90191a3ccbf9de7707e04f.png)
![](https://i-blog.csdnimg.cn/blog_migrate/da10ea1b8cb5b3de851855548912fd89.png)
![](https://i-blog.csdnimg.cn/blog_migrate/e9699f4e437fd003eb9a2bcb23cba52f.png)
具体插件来源与添加参考了这个博主的文章:
唐朝诗人白居易曾在《眼暗》一诗中写道:
早年勤倦看书苦,晚岁悲伤出泪多。
眼损不知都自取,病成方悟欲如何。
身体是革命的本钱,让我们快快给keil5换上护眼的背景,好好保护我们自己的眼睛吧!
最后,如果觉得有用就点个赞吧!