当前位置:网站首页>Keil5-MDK的格式化代码工具及添加快捷方式
Keil5-MDK的格式化代码工具及添加快捷方式
2022-07-06 09:24:00 【LLearners】
前言
keil有很多的功能以及Tools,今天我简单讲一个Tools。这个工具主要是适用于代码的一次性格式化。格式化就是针对代码的工整。代码适当的工整,有助于我们阅读代码。
每次编写代码,没有时时刻刻注意到代码的格式规范,总是有些文件的代码格式不规范,每次调整特别麻烦还总出错,特别是刚入门的小白。现在我们就使用一个工具Astyle,它可以方便的将程序代码格式化成自己想要的样式而不必人工修改。
为了更加方便操作,我们增加了格式化工具Astyle的快捷方式,就不用老是去使用鼠标点击,更加快速便捷的格式化代码。
Astyle 介绍
Astyle 即Artistic Style,是一个可用于C, C++, C++/CLI, Objective‑C, C# 和Java编程语言格式化开源工具。
官网:Artistic Style - Index
百度网盘链接:https://pan.baidu.com/s/11yloLOZWK0-7bnLSM4umRA#list/path
提取码:a6de
下面针对工具的配置和使用:格式化当前文件、格式化所有的.c文件,格式化所有的.h文件、快捷方式设置
keil(MDK)中加载工具 Astyle(格式化当前文件工具设置)
- 在Astyle官网 下载最新编译好的Astyle。或者百度网盘下载。
- 下载完成后,解压到一个目录下,进入解压文件下找到bin下的 Astyle.exe。
- 打开 keil(MDK) ,选择 Tools->Customize Tools Menu
- 第1步点击新建按钮,第步输入名称:格式化当前文件
- 第1步点击1位置,第2步点击2位置选择存放路径下的Astyle.exe文件
- 在下面位置输入命令(注意大小写):!E 输入完成后点击OK,会在tools里面出现如下图添加的工具。
- 上述配置完成,我们现在使用,找到一个文件,选择 Tools->格式化当前文件。图一是未格式化,图二是格式化后。
keil(MDK)中加载工具 Astyle(格式化.c和.h文件 工具设置)
- 配置和格式化当前文件一样。也是使用的是Astyle.exe文件
- 取名和另一个配置如图。.c文件配置:-n "$E*.c" .h文件配置:"$E*.h"
keil(MDK)快捷键执行代码的快速格式化(快速格式化工具设置)
Edit->Configuration切换到Shortcut Keys选项,选择格式化当前文件,点击Create Shortcut创建新的快捷键,在弹出的窗口按下你要设置的快捷键,然后保存退出,使用格式化就是自己设置的快捷键。如下是图文操作方式。
1.打开设置。Edit->Configuration->Shortcut Keys
2.按照如图的方式设置。图中第5步使用直接输入自己的命令。如:Ctrl + T
————————————————
版权声明:本文为CSDN博主「LLearner」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
博客:LLearners的博客_CSDN博客-领域博主
原文链接:https://blog.csdn.net/weixin_70641798?type=blog
边栏推荐
- 安全面试之XSS(跨站脚本攻击)
- How does SQLite count the data that meets another condition under the data that has been classified once
- Matplotlib绘图快速入门
- Pointers: maximum, minimum, and average
- Network technology related topics
- 攻防世界MISC练习区(gif 掀桌子 ext3 )
- Fundamentals of digital circuit (IV) data distributor, data selector and numerical comparator
- Detailed explanation of network foundation
- 《统计学》第八版贾俊平第九章分类数据分析知识点总结及课后习题答案
- 浙大版《C语言程序设计实验与习题指导(第3版)》题目集
猜你喜欢
《统计学》第八版贾俊平第八章假设检验知识点总结及课后习题答案
Windows platform mongodb database installation
Attack and defense world misc practice area (GIF lift table ext3)
Statistics, 8th Edition, Jia Junping, Chapter 11 summary of knowledge points of univariate linear regression and answers to exercises after class
Lintcode logo queries the two nearest saplings
Markdown font color editing teaching
数据库多表链接的查询方式
servlet中 servlet context与 session与 request三个对象的常用方法和存放数据的作用域。
网络基础详解
Network layer - simple ARP disconnection
随机推荐
JDBC read this article is enough
Detailed explanation of network foundation
ES全文索引
Statistics, 8th Edition, Jia Junping, Chapter 11 summary of knowledge points of univariate linear regression and answers to exercises after class
内网渗透之内网信息收集(二)
函数:求1-1/2+1/3-1/4+1/5-1/6+1/7-…+1/n
Apache APIs IX has the risk of rewriting the x-real-ip header (cve-2022-24112)
[paper reproduction] cyclegan (based on pytorch framework) {unfinished}
Get started with Matplotlib drawing
函数:用牛顿迭代法求方程的根
Record an API interface SQL injection practice
SQL注入
数据库多表链接的查询方式
The difference between layer 3 switch and router
Statistics 8th Edition Jia Junping Chapter 5 probability and probability distribution
“Hello IC World”
我的第一篇博客
WEB漏洞-文件操作之文件包含漏洞
函数:求两个正数的最大公约数和最小公倍
MySQL interview questions (4)