Files are formatted using =

To format an entire file, = can be applied to the length of the file.

gg take you to the top of the file.
G takes you to the bottom of the file.

So to format the entire file gg=G