If any one of you want to get auto indenting while writing code in vim editor and if you are fed up of giving command again and again in every page go to
/etc
and than open
file named vimrc using vim editor by command
vim vimrc
shown in images file before change and after change is shown below.