I have created some indentation commands like set shiftwidth=4, set autoindent and so on.... in my .vimrc file in my home folder and I'm able to get new files auto-indented happily. What I want to know is if there is some script or way to indent existing file as per a particular indentation (say indentation script written by me (.vimrc) or default indentation standard for a particular extension that vim is intelligent enough to do.... ) The existing file has no consistent indentation used. Hope the question is clear. 
indent an existing unindented file as per some indentation commands supposedly written for autoindenting new files
vimscript;indentation