当前位置:   article > 正文

VSCode C/C++ code format

VSCode C/C++ code format

Download astyle

https://sourceforge.net/projects/astyle/files/astyle/astyle%203.1/
添加到系统环境变量
在这里插入图片描述

VSCode AStyle 插件安装

在这里插入图片描述

settings.json

 "astyle.additional_languages": [
        "c",
        "cpp",
    ],
    "astyle.cmd_options": [
        "--style=google",
        "--indent=spaces=2",
        "--pad-oper",
        "--keep-one-line-statements",
    ],
    "astyle.executable": "D:/software/AStyle/bin/Astyle"
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

具体参数参考:http://astyle.sourceforge.net/astyle.html#_General_Information

Usage

  • ctrl+shift+p -> Format Document
  • shift+alt+f
  • 右键 -> Format Document/Format Document With
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/998154
推荐阅读
相关标签
  

闽ICP备14008679号