【Keil5】keil5修改主题背景颜色–仿VS Code 的Monokai主题

  • Post author:
  • Post category:其他


  • 我们第一次下载keil 5软件后,背景色默认为白色。当我们不喜欢白色作为背景时怎样去修改我们的主题背景?使它变成如下图呢?



一、通过程序内部进行修改

  1. 第一步,点击configure μVsion(图中的小扳手)
  2. 第二步,在对话框中选择 Color & Fonts
  3. 第三步,在左边的列表中选择 C/C++ Editor files
  4. 第四步,然后对右边列表中的各个元素都进行修改(包含了关键字、数字、字符串等等颜色和背景的修改)
  5. 第五步、在最右边对颜色、字体的大小和类型等按自己想要的风格进行修改

操作如下图所示

在这里插入图片描述



二、通过对global.prop文件进行主题修改

  1. 首先在安装路径中找到global.prop文件

自己的Keil安装路径→UV4→global.prop文件



2. 然后用记事本打开该文件,修改其中的代码。

在将修改后的代码保存后,重新打开keil就可以看到已经改好了风格



提供几个主题代码

  • 这里提供的代码,直接全部复制,然后将global.prop文件中的代码全部替换
  1. 黑色背景主题,如下图

# 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=#005EB3
caret.fore=#FFFFFF
caret.back=#000000

# 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=Fixedsys
font.acpmonofontname.cpp=Fixedsys
font.acppropfontname.cpp=Fixedsys
style.cpp.32=font:Fixedsys,size:14,fore:#9CDCFE,back:#1E1E1E
style.cpp.4=font:Fixedsys,size:14,fore:#4EC9B0,back:#1E1E1E
style.cpp.10=font:Fixedsys,size:14,fore:#DCDCDC,back:#1E1E1E
style.cpp.1=font:Fixedsys,size:14,fore:#57A64A,back:#1E1E1E
style.cpp.2=font:Fixedsys,size:14,fore:#007F00,back:#1E1E1E
style.cpp.5=font:Fixedsys,size:14,fore:#007ACC,back:#1E1E1E
style.cpp.6=font:Fixedsys,size:14,fore:#FF80FF,back:#1E1E1E
style.cpp.11=font:Fixedsys,size:14,fore:#DCDCDC,back:#1E1E1E
style.cpp.9=font:Fixedsys,size:14,fore:#4EC9B0,back:#1E1E1E
style.cpp.7=font:Fixedsys,size:14,fore:#FF80FF,back:#1E1E1E
style.cpp.34=font:Fixedsys,size:14,fore:#500000,back:#007ACC
style.cpp.35=font:Fixedsys,size:14,fore:#FF0000,back:#1E1E1E
style.cpp.16=font:Fixedsys,size:14,fore:#9CDCFE,back:#1E1E1E
style.cpp.12=font:Fixedsys,size:14,fore:#FF80FF,back:#1E1E1E
style.cpp.86=font:Fixedsys,size:14,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

2.仿VS Code 的Monokai主题,如图

在这里插入图片描述

# 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=1
save.prj.before.dbg=0
save.files.before.dbg=0
function.scanner.project=1
function.scanner.files=1
function.scanner.modules=0

# 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=1
autosave.interval=5

# vertical edge at right margin
edge.mode=0
edge.column=80


# Specification for text selection and caret line
selection.fore=#272822
selection.back=#F8F8F2
caret.fore=#FFFFFF
caret.back=#31282C

# 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
font.acpmonofontname.cpp=Courier New
font.acppropfontname.cpp=Courier New
style.cpp.32=font:Courier New,size:11,fore:#F8F8F2,back:#272822
style.cpp.4=font:Courier New,size:11,fore:#AE81FF,back:#272822
style.cpp.10=font:Courier New,size:11,fore:#FF8000,back:#272822
style.cpp.1=font:Courier New,size:11,fore:#88846F,back:#272822
style.cpp.2=font:Courier New,size:11,fore:#78745F,back:#272822
style.cpp.5=font:Courier New,size:11,fore:#F92672,back:#272822
style.cpp.6=font:Courier New,size:11,fore:#E2E22E,back:#272822
style.cpp.11=font:Courier New,size:11,fore:#F8F8F2,back:#272822
style.cpp.9=font:Courier New,size:11,fore:#A6E22E,back:#272822
style.cpp.7=font:Courier New,size:11,fore:#FF8064,back:#272822
style.cpp.34=font:Courier New,size:11,fore:#66D9EF,back:#272822
style.cpp.35=font:Courier New,size:11,fore:#FF0000,back:#272822
style.cpp.16=font:Courier New,size:11,fore:#F92672,back:#272822
style.cpp.12=font:Courier New,size:11,fore:#FF0080,back:#272822
style.cpp.86=font:Courier New,size:11,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=Courier New
style.txt.32=font:Verdana,size:10,fore:#000000,back:#FFFFFF

  1. keil默认主题,即原主题,如图

在这里插入图片描述

# 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

(最后,如果大家还有更多好看的主题,也可以分享)



版权声明:本文为coollingomg原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。