The equals symbol (=) re-indents code based on your indent settings. Depending on your coding style, if you have smartindent or cindent enabled, the following may be all you need: ggVG=

This visually selects every line in the file and then re-indents them.

This won't be smart enough to preserve any personal formatting styles, such as aligning arguments of a function call underneath the opening bracket.