2023年7月9日发(作者:)
sourceinsight代码格式化source insight代码格式化(Astyle) GNU的astyle是⼀个免费的代码格式化⼯具,能够格式化c/c++等代码 , 我们可以将外挂到SourceInsight中,具体步骤如下:1、下载Astyle⼯具2、source insight中挂载Astyle⼯具a、将AStyle_2.02_解压到D:lb⽬录下(可以放在任意⽬录)。b、在SourceInsight菜单栏⾥,Options-->Custom Commands界⾯上选择:Add,在弹出对话框写⼊ 命令名,在run中添加相应的命令。 1)ansi C 格式化当前⽂件的命令为:"D:ToolsAStyle_3.1_" --style=ansi -s4 -S -N -L -m0 -M40--convert-tabs --suffix=.pre %f
2)ansi C 格式化某个⽬录下所有⽂件的命令为:"D:" Z:LocalProjectDEZHOU3716/*.cZ:LocalProjectDEZHOU3716/*.h -- style=ansi -s4 -S -N -L -m0 -M40 --recursive --convert-tabs --suffix=.pre%f 3)Linx C 格式化代码的命令如下 "D:ToolsAStyle_3.1_" --style=linux -t -S -N -L -m0 -M40 --convert-tabs --indent=force-tab=8 --suffix=.pre %fTAB键为8个空格,这个格式是我⽤来格式化编写内核代码的时候⽤到的reference如下 c、在SourceInsight菜单栏⾥,Options-->Key Assignments 界⾯上选择:Keys,在弹出对话框的Command框的列表中找到你定义的命令名,然后点击Assign New Key,接着按下你要设置的快捷键。3、Astyle参数说明
发布者:admin,转转请注明出处:http://www.yc00.com/web/1688904295a182172.html
评论列表(0条)