Auto indent

To make vim auto indent when you start a new line. Putting this to your .vimrc

  filetype plugin indent on
  set autoindent

if you want more control over the indenting behavior:

set expandtab #use space instead of tab character
set shiftwidth=4 #indenting is 4 spaces

Auto insert close bracket

If you want vim insert close bracket for you, install delimitMate