Vim offers very granular control over whitespace. This episode explains the purpose of tabstop, softtabstop, shiftwidth and expandtab settings, and illustrates how Vim behaves using various combinations of these.
tabstop
softtabstop
shiftwidth
expandtab