eclipse 设置 tab width 为 4 个空格 (spaces)
1. Window -> Preferences -> General -> Editors -> Text Editors,选中右侧的 Insert space for tabs.
Apply and Close.
2. Window -> Preference -> C++ -> Code Style -> Formatter,点击右侧的Editor,选择左侧 Tab policy 的值为 Spaces only,应用即可。
若出现应用 Apply 按钮为灰色的情况,需要回到上一步。点击 New... 按钮,根据当前的样式重新生成一个新的样式并保存,重复第2步,编辑该样式即可。