1

I'm dealing with some code written in manner that is really, honestly, ugly. Is there a way to auto enforce proper tabs and remove all of the random multi-line white space entries?

4

2 回答 2

4

老 Unix 人对一切都有解决方案,包括懒惰的程序员。输入GNU 缩进。

于 2012-09-20T18:02:02.060 回答
1

您可以使用任何编辑器,但我更喜欢使用 Vim,使用 vim 您实际上可以通过在可视模式下选择所有代码然后选择“=”来提供适当的选项卡。您还必须为仅 3 个空格相等的制表符设置 sw=3 - 大多数代码中的首选间距。还要设置 expandtabs 这将确保代码看起来与将 '\t' 替换为 3 个空格相同

于 2012-09-20T18:02:28.363 回答