在ubuntu vscode配置 astyle

1.ubuntu安装astyle

sudo apt install astyle

2.vscode安装扩展 astyle

3.在setting.json配置风格

        

"astyle.executable": "/usr/bin/astyle",

"astyle.additional_languages": [

"c",

"cpp",

"*.h",

],

"astyle.cmd_options": [

"--recursive",

"--style=linux",

"--convert-tabs",

"--indent=spaces=4", // 每行4空格缩进

"--max-code-length=80", // 每行80个字符长度

"--attach-closing-while",

"--attach-return-type-decl",

"--indent-switches",

"--indent-continuation=4",

"--indent-preproc-block",

"--indent-preproc-define",

"--indent-preproc-cond",

"--indent-col1-comments",

"--pad-oper",

"--pad-comma",

"--pad-header",

"--unpad-paren",

"--align-pointer=name",

"--align-reference=name",

"--break-closing-braces", // 大括号后换行

"--add-braces",

],

4.使用 ctrl+shit+i执行格式化代码

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值