eclipse PDTのエディタでPHP, CSS, JavaScript, HTML, XMLを編集するときにTabの替わりにspaceを挿入するには、次の設定を変更します。(eclipse 3.3.2 + PDT 1.0.3の例)
Window > Preference...で、
- General > Editors > Text Editors > Displayed tab width, Insert spaces for tabs
- PHP > Formatter > Tab policy, Indentation size
- Web and XML > CSS Files > Source > Indent using spaces, Indentation size
- Web and XML > HTML Files > Source > Indent using spaces, Indentation size
- Web and XML > JavaScript Files > Source > Indent using spaces, Indentation size
また、eclipse CDTでC/C++のファイルを編集するときは、次の項目も設定します。
- C/C++ > Code Style > Edit... > Tab policy, Tab size
さらに、Project毎の設定が有効になっているときは、Projectのプロパティを開いて、次の項目を設定します。
- Formatter > Formatting > Tab policy, Indentation size
変更箇所が意外に多いので、設定したつもりがいくつか設定し忘れていると、いつの間にかtabが入ってしまっているということがよくありますので気をつけたいですね。





