Configuring C/C++ editor formatting

You can configure the C/C++ Code Style Formatter preference page to force the use of spaces instead of tabs for indentation in the C/C++ editor.

Procedure

  1. Click Window > Preferences > C/C++ > Code Style > Formatter to open the Formatter preference page.
  2. Click New to create a new profile.
  3. In the Profile name field, enter the profile name as GNU [my_company], where my_company is the name of your company or organization, for example, GNU [tpflab].
  4. From the Initialize settings with the following profile list, select GNU [built-in].
  5. Ensure that the Open the edit dialog now checkbox is selected.
  6. Click OK.
  7. In the Indentation tab of the opened window, select Spaces only from the Tab policy list, and click OK.
  8. On the Formatter preference page, ensure that the GNU [my_company] profile is selected in the Active profile list.
  9. Click Apply and Close.