我正在使用 sublime text 3 编写 C++ 代码。 我们关注Google style guide for CPP .
我正在寻找任何使用样式指南作为引用来提供自动重新缩进和 linter 支持的插件。
最佳答案
我刚试过 https://github.com/timonwong/SublimeAStyleFormatter它似乎工作正常。
您必须将用户设置(“Sublime Text”>“首选项”>“SublimeAStyleFormatter”>“设置 - 用户”)编辑为以下内容:
// This is a simplified settings file that only defines the coding style of your project
{
"options_default": {
// Default bracket style
// Can be either "allman", "ansi", "bsd", "break", "java", "attach", "kr", "k&r",
// "k/r" "stroustrup", "whitesmith", "banner", "gnu", "linux", "horstmann",
// "1tbs", "otbs ", "pico", "lisp", "python", or ""
"style": "google"
}
}
你可以有一些有趣的选项,比如“autoformat_on_save”、缩进等等。
关于c++ - 对谷歌风格指南的 Sublime Text 支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29268010/