📄 astyle.html
字号:
brackets=attach<br>
</tt></font><font color="#ff0000" size="3" face="Times New Roman"><tt># set 6
spaces per indent</tt></font><font color="#800080" size="3" face="Times New Roman"><tt><br>indent=spaces=6<br>
</TT></font><font color="#ff0000" size="3" face="Times New Roman"><tt># indent
switch blocks</tt></font><font color="#800080" size="3" face="Times New Roman"><tt><br>
indent-switches</tt></font><font color="#000000" size="3"><br>
</font><font color="#ff0000" size="3" face="Times New Roman"><tt># suffix of original
files should be .pre</tt></font><font color="#000000" size="3" face="Times New Roman"><tt><br>
</tt></font><font color="#800080" size="3" face="Times New Roman"><tt>suffix=.pre<br>
</tt></font>
</p>
</blockquote>
</li>
</ul>
<p><font color="#000000" size="4">The following </font><font color="#000099" size="4"><b>predefined
style</b></font><font color="#000000" size="4"><b> options</b> are
currently avaiable:</font></p>
<blockquote>
<p><font color="#000080" size="3"><strong>--style=ansi</strong></font><font color="#000000" size="3"><br>
</font>ANSI style formatting/indenting.</p>
<blockquote>
<p><font color="#800080" size="3"><b><tt>namespace foospace<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
int Foo()<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
if (isBar)<br>
</tt></b></font><font color="#ff0000" size="3">
<b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
bar();<br>
return 1;<br>
</tt></b></font><font color="#ff0000" size="3">
<b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt><br>
else<br>
return 0;<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt><br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font></p>
</blockquote>
<p><font color="#000080"><strong>--style=kr</strong></font><br>
Kernighan&Ritchie style formatting/indenting.</p>
<blockquote>
<p><font color="#800080" size="3"><b><tt>namespace foospace</tt></b></font><font color="#ff0000" size="3"><b><tt>
{</tt></b></font><font color="#800080" size="3"><b><tt><br>
int Foo()</tt></b></font><font color="#ff0000" size="3"><b><tt>
{</tt></b></font><font color="#800080" size="3"><b><tt><br>
if (isBar)</tt></b></font><font color="#ff0000" size="3"><b><tt>
{</tt></b></font><font color="#800080" size="3"><b><tt><br>
bar();<br>
return 1;<br>
</tt></b></font><font color="#ff0000" size="3">
<b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt> else<br>
return 0;<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt><br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font></p>
</blockquote>
<p><font color="#000080"><strong>--style=linux</strong></font><br>
Linux style formatting/indenting (brackets are broken apart from class/function
declarations, but connected to command lines, and indents are set to 8 spaces).</p>
<blockquote>
<p><font color="#800080" size="3"><b><tt>namespace foospace<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
int Foo()<br>
</tt></b></font><font color="#ff0000" size="3">
<b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
if
(isBar)</tt></b></font><font color="#ff0000" size="3"><b><tt> {</tt></b></font><font color="#800080" size="3"><b><tt><br>
bar();<br>
return 1;<br>
</tt>
</b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt>
else </tt></b></font><font color="#800080" size="3"><b><tt>
<br>
return 0;<br>
</tt></b></font><font color="#ff0000" size="3">
<b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt><br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font></p>
</blockquote>
<p><font color="#000080"><strong>--style=gnu</strong></font><br>
GNU style formatting/indenting.</p>
<blockquote>
<p><font color="#800080" size="3"><b><tt>namespace foospace<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
int Foo()<br>
</tt></b></font><font color="#ff0000" size="3">
<b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
if (isBar)<br>
</tt></b></font><font color="#ff0000" size="3">
<b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
bar();<br>
return 1;<br>
</tt></b></font><font color="#ff0000" size="3">
<b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt><br>
else<br>
return 0;<br>
</tt></b></font><font color="#ff0000" size="3">
<b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt><br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font></p>
</blockquote>
<p><font color="#000080"><strong>--style=java</strong></font><br>
Java style formatting/indenting.</p>
<blockquote>
<p><font color="#800080" size="3"><b><tt>class foospace</tt></b></font><font color="#ff0000" size="3"><b><tt>
{</tt></b></font><font color="#800080" size="3"><b><tt><br>
int Foo()</tt></b></font><font color="#ff0000" size="3"><b><tt>
{</tt></b></font><font color="#800080" size="3"><b><tt><br>
if (isBar)</tt></b></font><font color="#ff0000" size="3"><b><tt>
{</tt></b></font><font color="#800080" size="3"><b><tt><br>
bar();<br>
return 1;<br>
</tt></b></font><font color="#ff0000" size="3">
<b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt> else<br>
return 0;<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt><br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font></p>
</blockquote></blockquote>
<p><font color="#000000" size="4">The following </font><font color="#000099" size="4"><b>indentation</b></font><font color="#000000" size="4"><b>
options</b> are currently available:</font></p>
</blockquote><blockquote> <blockquote>
<p><font color="#000080" size="3"><b>-c</b></font><font color="#000080" size="4"><b> </b>
</font><font size="3">OR </font><font color="#000080" size="3"><strong>--mode=c</strong></font><font size="3"><br>
Indent a C, C++ or C# file.</font><font size="2"> </font>
</p>
<p><font color="#000080" size="3"><b>-j</b></font><font size="3"> OR </font><font color="#000080" size="3">
<strong>--mode=java</strong></font><font size="3"><br>
Indent a Java file.</font><font size="2"> </font>
</p>
<p><font color="#000080" size="4"><b>-s</b></font><font color="#ff0000" size="4"><b>#</b></font><font size="3">
OR </font><font color="#000080" size="3"><strong>--indent=spaces=</strong></font><font color="#ff0000" size="3"><strong>#</strong></font><font size="3"><br>
Indent using </font><font color="#ff0000" size="3">#</font><font size="3"> spaces
per indent (e.g. </font><font size="4"><b>-s</b></font><font color="#ff0000" size="3"><b>4</b></font><font size="3">
OR <strong>--indent=spaces=</strong></font><font color="#ff0000" size="3"><strong>4</strong></font><font size="3">).</font>
</p>
<p><font color="#000080" size="4"><strong>-t </strong><font color="#000000" size="3">OR</font><strong>
-t<font color="red">#</font></strong></font><font size="3"> OR </font><font color="#000080" size="3">
<strong>--indent=tab=<font color="red">#</font></strong></font><font size="3"><br>
Indent using tab characters.</font> Treat each tab as <font color="red">#</font>
spaces. If no '#' is set, treats tabs as 4 spaces.</p>
<p><font color="#000080" size="4"><strong>-T<font color="red">#</font></strong><font size="3"><font color="#000000">
OR </font><font color="#000080"><strong>--force-indent=tab=<font color="red">#</font></strong></font><br>
<font color="#000000">Indent using tab characters.</font><font color="#000000"> Treat
each tab as </font><font color="red">#</font><font color="#000000"> spaces.
Uses tabs as indents in areas '--indent=tab' prefers to use spaces, such as
inside multi-line statements.</font></font></font></p>
<p><font color="#000080" size="4"><strong>-C</strong></font><font size="3"> OR</font><font color="#000080" size="4"><b>
--</b></font><font color="#000080" size="3"><b>indent-classes</b></font><font size="2"><br>
</font><font size="3">Indent 'class' blocks so that the headers 'public:',
'protected:' and 'private:' are indented in the class block.</font></p>
<blockquote>
<p><font color="#330000" size="3">The default:</font></p>
</blockquote><blockquote>
<p><font color="#800080" size="3"><b><tt>class Foo<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
public:<br>
Foo();<br>
virtual ~Foo();<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt>;</tt></b></font></p>
<p><font color="#330000" size="3">becomes:</font>
</p>
<p><font color="#800080" size="3"><b><tt>class Foo<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
public:<br>
Foo();<br>
virtual ~Foo();<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt>;</tt></b></font></p>
</blockquote>
<p><font color="#000080" size="4"><b>-S</b></font><font size="3"> OR</font><font color="#000080" size="4"><b>
--</b></font><font color="#000080" size="3"><b>indent-switches</b></font><font size="2"><br>
</font><font size="3">Indent 'switch' blocks so that the 'case XXX:' headers are
indented in the class block.</font></p>
<blockquote>
<p><font color="#330000" size="3">The default:</font></p>
</blockquote><blockquote>
<p><font color="#800080" size="3"><b><tt>switch (foo)<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
case 1:<br>
a += 2;<br>
break;<br>
<br>
default:<br>
a += 2;<br>
break;<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font></p>
<p><font color="#330000" size="3">becomes:</font>
</p>
<p><font color="#800080" size="3"><b><tt>switch (foo)<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
case 1:<br>
a += 2;<br>
break;<br>
<br>
default:<br>
a += 2;<br>
break;<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font></p>
</blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -