最近经常用keil5,字很小背景反光很强,眼睛都要瞎了,于是突发奇想,能不能把keil5背景改成护眼的绿色,结果效果还蛮不错的
![](https://img-blog.csdnimg.cn/d77ffe2c39cc4dd7b19062674ff5905f.png)
顺便搞了一款葛巾紫的高级感配色
![](https://img-blog.csdnimg.cn/13bf2f97e7fc4a43b0d3dff64279e98c.png)
具体更改方法有两个,第一个方法是打开keil5的UV4文件夹,将global.prop文件以文本形式打开(如下图),再将下面代码复制进去,替换掉原代码。
![](https://img-blog.csdnimg.cn/1a321a36fb494d05a988c076aa4826f4.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://img-blog.csdnimg.cn/935afe69d0b14c559d11a452835df2cc.png)
再者就是keil5好用插件的推荐了,可以试试下面这款插件,能实现一键打出注释模版的功能。插件百度网盘链接:
https://pan.baidu.com/s/1XIYWjekZpUKV2cDAgU02QQ
提取码: c2k5
![](https://img-blog.csdnimg.cn/f968500a0ebd4e6680028ad3dc6e3d63.png)
将插件tools解压到keil5文件夹里,重启keil5,点开tools里的customize tools menu,将插件里的文件添加到里面,操作如下所示
![](https://img-blog.csdnimg.cn/d3804c35ce804ca79eb031bfded3280d.png)
![](https://img-blog.csdnimg.cn/5f5cc172f69347c284bc40d7e1fc24b7.png)
![](https://img-blog.csdnimg.cn/f4cbdb9c28ec4a20a3b59878e513d7be.png)
![](https://img-blog.csdnimg.cn/ea9863c031e64547bb731d40c3552ddc.png)
![](https://img-blog.csdnimg.cn/5c32cf5967dd4236b57846a16805e23a.png)
![](https://img-blog.csdnimg.cn/d476aba266a64c5b960274bf5ce0e3ea.png)
具体插件来源与添加参考了这个博主的文章:
唐朝诗人白居易曾在《眼暗》一诗中写道:
早年勤倦看书苦,晚岁悲伤出泪多。
眼损不知都自取,病成方悟欲如何。
身体是革命的本钱,让我们快快给keil5换上护眼的背景,好好保护我们自己的眼睛吧!
最后,如果觉得有用就点个赞吧!