📄 astyle.html
字号:
<p><font color="#000080" size="4"><b>-K</b></font><font size="3"> OR</font><font color="#000080" size="4"><b>
--</b></font><font color="#000080" size="3"><b>indent-cases</b></font><font size="2"><br>
</font><font size="3">Indent 'case XXX:' lines so that they are flush with the
comand lines under them.</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>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{<br>
</tt></b></font><font color="#800080" size="3"><b><tt>
a += 2;<br>
break;<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>}<br>
</tt></b></font><font color="#800080" size="3"><b><tt>
<br>
default:<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{<br>
</tt></b></font><font color="#800080" size="3"><b><tt>
a += 2;<br>
break;<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>
<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>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{<br>
</tt></b></font><font color="#800080" size="3"><b><tt>
a += 2;<br>
break;<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>}<br>
</tt></b></font><font color="#800080" size="3"><b><tt>
<br>
default:<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{<br>
</tt></b></font><font color="#800080" size="3"><b><tt>
a += 2;<br>
break;<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" size="4"><b>-B</b></font><font size="3"> OR</font><font color="#000080" size="4"><b>
--</b></font><font color="#000080" size="3"><b>indent-brackets</b></font><font size="3"><br>
Add extra indentation to brackets.</font>
</p>
<blockquote>
<p><font color="#330000" size="3">The default:</font></p>
<p><font color="#993399" size="3"><b><tt>if (isFoo)</tt></b></font>
<br>
<font color="#ff0000" size="3"><b><tt>{</tt></b></font>
<br>
<font size="3"><b><tt> </tt></b></font><font color="#993399" size="3">
<b><tt>bar();</tt></b></font>
<br>
<font color="#ff0000" size="3"><b><tt>}</tt></b></font>
<br>
<font color="#993399" size="3"><b><tt>else</tt></b></font>
<br>
<font color="#ff0000" size="3"><b><tt>{</tt></b></font>
<br>
<font size="3"><b><tt> </tt></b></font><font color="#993399" size="3">
<b><tt>anotherBar();</tt></b></font>
<br>
<font color="#ff0000" size="3"><b><tt>}</tt></b></font></p>
<p><font color="#330000" size="3">becomes:</font>
</p>
<p><font color="#993399" size="3"><b><tt>if (isFoo)</tt></b></font>
<br>
<font size="3"><b><tt> </tt></b></font><font color="#ff0000" size="3">
<b><tt>{</tt></b></font>
<br>
<font size="3"><b><tt> </tt></b></font><font color="#993399" size="3">
<b><tt>bar();</tt></b></font>
<br>
<font size="3"><b><tt> </tt></b></font><font color="#ff0000" size="3">
<b><tt>}</tt></b></font>
<br>
<font color="#993399" size="3"><b><tt>else</tt></b></font>
<br>
<font size="3"><b><tt> </tt></b></font><font color="#ff0000" size="3">
<b><tt>{</tt></b></font>
<br>
<font size="3"><b><tt> </tt></b></font><font color="#993399" size="3">
<b><tt>anotherBar();</tt></b></font>
<br>
<font size="3"><b><tt> </tt></b></font><font color="#ff0000" size="3">
<b><tt>}</tt></b></font></p>
</blockquote>
<p><font color="#000080" size="4"><b>-G</b></font><font size="3"> OR</font><font color="#000080" size="4"><b>
--</b></font><font color="#000080" size="3"><b>indent-blocks</b></font><font size="3"><br>
Add extra indentation to entire blocks.</font>
</p>
<blockquote>
<p><font color="#330000" size="3">The default:</font></p>
<p><font color="#993399" size="3"><b><tt>if (isFoo)</tt></b></font>
<br>
<font color="#ff0000" size="3"><b><tt>{</tt></b></font>
<br>
<font size="3"><b><tt> </tt></b></font><font color="#993399" size="3">
<b><tt>bar();</tt></b></font>
<br>
<font color="#ff0000" size="3"><b><tt>}</tt></b></font>
<br>
<font color="#993399" size="3"><b><tt>else</tt></b></font>
<br>
<font size="3"><b><tt> </tt></b></font><font color="#993399" size="3">
<b><tt>anotherBar();</tt></b></font>
</p>
<p>becomes:</p>
<p><font color="#993399" size="3"><b><tt>if (isFoo)</tt></b></font>
<br>
<font size="3"><b><tt> </tt></b></font><font color="#ff0000" size="3">
<b><tt>{</tt></b></font>
<br>
<font size="3"><b><tt> </tt></b></font><font color="#993399" size="3">
<b><tt>bar();</tt></b></font>
<br>
<font size="3"><b><tt> </tt></b></font><font color="#ff0000" size="3">
<b><tt>}</tt></b></font>
<br>
<font color="#993399" size="3"><b><tt>else</tt></b></font> <font face="Courier New" size="3">
<b><tt>
<br>
</tt></b></font><font size="3"><b><tt> </tt></b></font>
<font color="#993399" size="3"><b><tt>anotherBar();</tt></b></font>
</p>
</blockquote>
<p><font color="#000080" size="4"><b>-N</b></font><font size="3"> OR</font><font color="#000080" size="4"><b>
--</b></font><font color="#000080" size="3"><b>indent-namespaces</b></font><font size="2"><br>
</font><font size="3">Add extra indentation to namespaces.</font>
</p>
<blockquote>
<p><font color="#330000" size="3">The default:</font></p>
</blockquote><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>
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>;<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>namespace foospace<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
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>;<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font></p>
</blockquote>
<p> </p>
<p><font color="#000080" size="4"><b>-L</b></font><font size="3"> OR</font><font color="#000080" size="4"><b>
--</b></font><font color="#000080" size="3"><b>indent-labels</b></font><font size="2"><br>
</font><font size="3">Add extra indentation to labels so they they appear 1 indent
less than the current indentation, rather than being flushed to the left (the
default).</font>
</p>
<blockquote>
<p><font color="#330000" size="3">The default:</font></p>
</blockquote><blockquote>
<p><font color="#800080" size="3"><b><tt>int foospace()<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
while (isFoo)<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{<br>
</tt></b></font><font color="#800080" size="3"><b><tt>
...</tt></b></font><font color="#ff0000" size="3"><b><tt><br>
</tt></b></font><font color="#800080" size="3"><b><tt>
goto error;<br>
<br>
error:<br>
...<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>
<p><font color="#330000" size="3">becomes:</font>
</p>
<p><font color="#800080" size="3"><b><tt>int foospace()<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
while (isFoo)<br>
</tt></b></font><font color="#ff0000" size="3"><b><tt>{<br>
</tt></b></font><font color="#800080" size="3"><b><tt>
...</tt></b></font><font color="#ff0000" size="3"><b><tt><br>
</tt></b></font><font color="#800080" size="3"><b><tt>
goto error;<br>
<br>
error:<br>
...<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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -