Set tabstop and shiftwidth to 4 spaces. Set "smart"indent.