In command mode(Esc) enter :gg=G to use Vim's built-in indention engine.
Command PartDescriptionggstart of file=indent (when equalprg is empty)Gend of file
You can set equalprg in your .vimrc to use a more sophisticated auto-formatting tool.
For example, to use clang-format for C/C++ put the foll...