In order to have code formatting consistency, we may choose to use only tabs or only spaces in the source code.
We chose to only use spaces since that makes sure the code will be properly formatted in any text editor.
In order to create 4 spaces while pressing tabs in vi, edit your vi settings:
and add the 3 lines below to your config file
The next time you’ll use vi, pressing the tabulation key will create 4 spaces.
However, in some cases, e.g. Makefile, you may still need to use real tabs. Just press Ctrl+V then tab to create a real tab.