Artificial intelligent assistant

Auto indent / format code for Vim? I'm trying to use Vim more and more when I can. One of my biggest grip between Vim and an IDE like Aptana is the ability to auto indent. Is there a means of auto formatting code (HTML, CSS, PHP) so it is properly indented? If so how do you install this into vim? I don't understand plugins very much. I tried reviewing this thread and it confused me more: How to change vim auto-indent behavior?

To indent the whole file automatically:


gg
=G


Explained:

* `gg` \- go to beginning of the file
* `G` \- go to end of the file
* `=` \- indent

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 79cb144a7b38b6f881bc4843c85f80ee