nick_name
nick_name

Reputation: 1373

ansi c - auto clean up ugly code

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?

Upvotes: 1

Views: 263

Answers (2)

VThapa
VThapa

Reputation: 9

You can use any editor but I would prefer using Vim, with vim you can actually give proper tabs by selecting all the code in visual mode and then '='. You will also have to set sw=3 for only 3 space equal tab - preferred spacing in most of the code. Also set expandtabs this will ensure the code will look the same as it will replace '\t' with 3 space

Upvotes: 1

user529758
user529758

Reputation:

Old Unix people have a solution for everything, including lazy programmers. Enter GNU indent.

Upvotes: 4

Related Questions