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: http://unix.stackexchange.com/questions/17870/how-to-change-vim-auto-indent-behavior