1、打开Vs找到tools如下图
2、在线查找插件:
3、在新加的地方找到插件进行打开设置
4、可以选自己喜欢的格式:
5、这是我的格式代码:喜欢的可以直接用:--style=allman --indent=spaces=4 --indent-classes --indent-modifiers --indent-switches --indent-cases --indent-namespaces --indent-labels --indent-preproc-block --indent-col1-comments --break-blocks --break-blocks=all --pad-oper --pad-paren-out --pad-first-paren-out --pad-header --unpad-paren --delete-empty-lines --fill-empty-lines --break-elseifs --add-brackets --add-one-line-brackets --keep-one-line-blocks --mode=c
6、设置快捷键:我设的alt+S,