Code::Blocks 使用 AStyle 格式化 C/C++ 代码

AStyle

A Free, Fast, and Small Automatic Formatter
for C, C++, C++/CLI, Objective‑C, C#, and Java Source Code

Project Page: http://astyle.sourceforge.net/
SourceForge: http://sourceforge.net/projects/astyle/

Artistic Style is a source code indenter, formatter, and beautifier for the C, C++, C++/CLI, Objective‑C, C# and Java programming languages.

Code::Blocks Source code formatter plugin

Code::Blocks 的 Source code formatter plugin 使用 AStyle 格式化 C/C++ 代码。

Settings -> Editor -> Source formatter

Style

Figure 1: Style

Brackets

Figure 2: Brackets

Indentation

Figure 3: Indentation

Formatting

Figure 4: Formatting

Padding

Figure 5: Padding

Source code formatter (AStyle) shortcut

Settings -> Editor -> Keyboard shortcuts -> Plugins -> Source code formatter (AStyle)

shortcut: Ctrl-Shift-I(Indent)

posted @ 2018-04-18 01:36  yongwu  阅读(499)  评论(0编辑  收藏  举报