keil舒适的护眼色设置

博客介绍了建立global.prob文件并保存,之后将该文件复制到Keil5安装目录G:\\Keil5\\UV4的操作过程。

建立如下文件:
global.prob
内容如下:

# properties for all file types
indent.automatic=1
virtual.space=0
view.whitespace=0
view.endofline=0
code.page=0
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=2
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=2
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=1

# autosave for editor files
autosave=0
autosave.interval=5


# Specification for text selection and caret line
selection.fore=#000000
selection.back=#005EB3
caret.fore=#FFFFFF
caret.back=#000000

# 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=Consolas

    style.cpp.32=font:Consolas,size:14,fore:#FF972F,back:#152B2B

    style.cpp.4=font:Consolas,size:14,fore:#007F7F,back:#152B2B

    style.cpp.10=font:Consolas,size:14,fore:#FF8040,back:#152B2B

    style.cpp.1=font:Consolas,size:14,fore:#AAFFFF,back:#152B2B

    style.cpp.2=font:Consolas,size:14,fore:#AAFFFF,back:#152B2B

    style.cpp.5=font:Consolas,size:14,fore:#BF0000,back:#152B2B

    style.cpp.6=font:Consolas,size:14,fore:#FF8040,back:#152BB

    style.cpp.11=font:Consolas,size:14,fore:#FF8040,back:#152B2B

    style.cpp.9=font:Consolas,size:14,fore:#FF0000,back:#152B2B

    style.cpp.7=font:Consolas,size:14,fore:#7F007F,back:#152B2B

    style.cpp.34=font:Consolas,size:14,fore:#500000,back:#152B2B

    style.cpp.35=font:Consolas,size:14,fore:#FF0000,back:#152B2B

    style.cpp.16=font:Consolas,size:14,fore:#B00040,back:#152B2B

    style.cpp.12=font:Consolas,size:14,fore:#000000,back:#152B2B

# 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:#FFFFFF,back:#191919

然后保存文件global.prob,复制此文件至keil5安装目录之下:G:\Keil5\UV4

如下图所示:
keil安装路径

此文件存放路径

在使用 Keil uVision 进行嵌入式开发时,长时间盯着默认的白色背景编辑器容易造成视觉疲劳。为了保护眼睛,可以将 Keil 的编辑器背景设置为**护眼绿、深色主题(Dark Mode)或柔和的灰黑色主题**。 虽然 Keil uVision 本身不内置“护眼模式”按钮,但你可以 **手动自定义颜色方案** 来实现护眼效果。 --- ### ✅ 方法:设置 Keil uVision 护眼颜色(以 Keil v5 为例) #### 步骤 1:打开颜色设置界面 > 打开 Keil uVision → `Edit` → `Configuration...` 弹出配置窗口后,选择左侧的 **Colors & Fonts** 选项卡。 #### 步骤 2:选择文本类型 在右侧选择你要修改的语言元素,例如: - C/C++ Editor Files - Asm Editor Files 然后可以分别设置: - **Text**(文字颜色) - **Background**(背景颜色) - **Keywords**(关键字颜色) - **Comments**(注释颜色) - **Strings**(字符串颜色) - 等等 --- ### 🎨 推荐护眼配色方案 #### 方案一:经典「豆沙绿」护眼色(适合白天) | 元素 | RGB 值 | 效果 | |------|--------|------| | Background(背景) | R:199, G:237, B:204 | 柔和豆沙绿 | | Text(文字) | R:0, G:0, B:0 | 黑色字体 | > 💡 原理:研究表明 `#C7EDCC`(豆沙绿)能缓解眼部疲劳。 ✅ 设置方法: - 在 Background 颜色栏点击 → 自定义颜色 → 输入 RGB 值:`199, 237, 204` - Text 设为黑色 `(0,0,0)` --- #### 方案二:深色主题(Dark Theme)——更推荐长期使用 | 元素 | RGB 值 | 说明 | |------|--------|------| | Background | R:30, G:30, B:30 | 深灰黑背景 | | Text | R:180, G:180, B:180 | 浅灰色文字 | | Keywords | R:255, G:255, B:100 | 淡黄色关键字 | | Comments | R:100, G:200, B:100 | 草绿色注释 | | Strings | R:255, G:150, B:150 | 浅红色字符串 | | Numbers | R:255, G:200, B:100 | 橙色数字 | 📌 优点: - 减少屏幕亮度刺激 - 更适合夜间编程 - 类似 VS Code / VS Studio 的暗色主题 --- ### ✅ 示例代码:如何设置(Markdown 格式) 虽然这不是程序代码,但以下是操作步骤的清晰表示: ```text Edit → Configuration → Colors & Fonts → Select: C/C++ Editor Files Background: R=199, G=237, B=204 ← 豆沙绿 Text: R=0, G=0, B=0 ← 黑色文字 Keywords: R=0, G=0, B=255 ← 蓝色关键字(可选) Comments: R=63, G=127, B=95 ← 暗绿色注释 ``` 或者深色主题: ```text Background: 30, 30, 30 Text: 180, 180, 180 Comments: 100, 200, 100 Keywords: 255, 255, 100 Strings: 255, 150, 150 ``` --- ### 🔧 小技巧:保存配置以便复用 设置完成后,可以导出你的配置文件供以后使用或迁移: > `Project` → `Manage` → `Project Items` → `Folders/Extensions` → 可备份整个工程模板 或者直接复制以下路径中的全局配置文件(包含颜色设置): ``` C:\Users\<你的用户名>\AppData\Roaming\Keil\UV4\UV4.ini ``` ⚠️ 修改前建议先备份此文件! --- ### 🌙 额外建议:开启系统级护眼模式 - Windows 开启「夜间模式」(设置 → 系统 → 显示 → 夜间模式) - 使用第三方工具如 f.lux 或 Windows 自带蓝光过滤 - 调整显示器亮度与对比度至舒适水平 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值