This describes how to configure Eclipse to play nicely with Drupal.
For PHPeclipse - PHP editing
We need to ensure that tab/indent inserts two spaces, and also that .inc, .module, .engine, .theme and .install files are recognised as PHP files.
Make the following changes under Window -> Preferences
- Expand the left-hand menu to General -> Content Types
Under "Content types" on the right, click Text -> PHP Source File
Add the *.engine, *.theme, *.install, *.inc, and *.module file types - In the left-hand menu click on PHPeclipse Web Development -> PHP
In the Typing tab, make sure the 'Insert Spaces for Tab' setting is checked
In the Appearance tab, it is reccommended that you leave the 'Displayed tab width' at 4, so it is easier to spot if any (actual) tabs have snuck in - In the left-hand menu click on PHPeclipse Web Development -> PHP -> Formatter
In the Style tab, enter 2 for 'Number of spaces representing a tab'
'Compact Assignment' and 'Indentation is represented by a tab' should both be unchecked
For Eclipse Web Tools - CSS, JS, XML and (X)HTML editing
Window -> Preferences -> Web and XML -> CSS Files -> CSS Source
Select 'Indent using spaces'
Set 'Intentation size' to 2
Window -> Preferences -> Web and XML -> Javascript Files -> Javascript Source
Select 'Indent using spaces'
Set 'Intentation size' to 2
Window -> Preferences -> Web and XML -> HTML Files -> HTML Source
Select 'Indent using spaces'
Set 'Intentation size' to 2
Window -> Preferences -> Web and XML -> XML Files -> XML Source
Select 'Indent using spaces'
Set 'Intentation size' to 2
If you use XTemplate:
Window -> Preferences -> General -> Content Types -> Text -> HTML
Add the *.xtmpl file type

No comments:
Post a Comment