Skip to content

Keil 配置

代码格式化

格式化当前文件

  • 创建菜单名称
  • 选择astyle地址
  • 输入格式化指令 !E -pnUk1s2 --style=linux

image-20250429174111435

image-20250429174156635

格式化工程

  • 创建菜单名称
  • 选择astyle地址
  • 注意:需要选择工程目录,否则格式化时可能找不到
  • 输入格式化指令*.c *.h --style=allman --recursive

image-20250429174223688

效果和快捷键

需要点击才能格式化,下面我们可以配置快捷键

image-20250429174343490

image-20250429174315139

其他配置

字体字号

image-20250429174411733

中文编码、tab

image-20250429174427409

注释快捷键

注释时需要先选中