vim set tab size

C++
set tabstop=4
:set tabstop=2 shiftwidth=2 expandtab
:retab

# tabstop		-> Indentation width in spaces
# shiftwidth	-> Autoindentation width in spaces
# expandtab		-> Use actual spaces instead of tabs
# retab			-> Convert existing tabs to spacesset shiftwidth=0
set tabstop=4
Source

Also in C++: