How do I fix the indentation of an entire file in Vi?

=, the indent command can take motions. So, gg to get the start of the file, = to indent, G to the end of the file, gg=G.

Leave a Comment