After trying out several editors and IDE’s for software development I’ve decided to settle on using Eclipse for 95% of the work I do and I’ll use Xcode only when forced to.

This quick blog post will assist you in getting Eclipse configured for developing anything to do with Drupal.

There are a few versions of Eclipse but the one I’ve found that works best for Drupal Development is the version put out by the PDT Project. The PDT project is working towards providing a PHP Development Tools framework for the Eclipse platform. This project will encompass all development components necessary to develop PHP and will facilitate extensibility.

After you have it installed, go to Windows -> Preferences and make the following changes:

  1. Content Types
    1. Expand the left-hand menu to General -> Content Types
    2. Under "Content types" on the right, click Text -> PHP Source File
    3. Add the *.info, *.engine, *.theme, *.install, *.inc, and *.module file types </ol>
    4. Tab formatting for PHP
      1. Expand the left-hand menu to PHP -> Formatter
      2. Check the "Indent using spaces" radio button.
      3. Change the indent size to 2. </ol>
      4. Tab formatting for CSS
        1. Expand the left-hand menu to Web and XML -> CSS Files -> CSS Source
        2. Select 'Indent using spaces'
        3. Set 'Intentation size' to 2 </ol>
        4. Tab formatting for JavaScript
          1. Expand the left-hand menu to Web and XML -> Javascript Files -> Javascript Source
          2. Select 'Indent using spaces'
          3. Set 'Intentation size' to 2 </ol>
          4. Tab formatting for HTML
            1. Expand the left-hand menu to Web and XML -> HTML Files -> HTML Source
            2. Select 'Indent using spaces'
            3. Set 'Intentation size' to 2 </ol>
            4. Tab formatting for XML
              1. Expand the left-hand menu to Web and XML -> XML Files -> XML Source
              2. Select 'Indent using spaces'
              3. Set 'Intentation size' to 2 </ol>
              4. Make it Unix-friendly
                1. Expand the left-hand menu to General ->Workspace
                2. Text File encoding should be UTF-8
                3. New text file line delimeter should be Unix </ol>
                4. Set default text mode to -kkv
                  1. Expand the left-hand menu to Team -> CVS
                  2. Click on the Files and Folders tab
                  3. set the "Default text mode" dropdown to "ASCII with keyword expansion (-kkv)" </ol>
                  4. Tabulators
                    1. Expand the left-hand menu to PHP -> Editor -> Typing
                    2. Check the "Tab key indents the current line" under Tabulators </ol> You should now have Eclipse properly configured for Drupal development work.