I set up this mapping in my .vimrc and it works great...
" Auto indent entire file
nmap <C-f> gg=G
imap <C-f> <ESC>gg=G
However, after the operation the cursor has moved to line 1, column 1.
Is there a way to do it so that if I'm in the middle of the file somewhere the cursor will remain where it is?