Adding the two closing braces and selecting the entire block with vi{ provided proper automatic indentation for me in gvim 7.2 with no plugins. You may want to see if an errant plugin is messing it up by starting vim with the --noplugins flag on the command line. and try again.