You are here
ECLIPSE + PHP + ANYEDIT
To change the syntax coloring, (Windows) go to Window > Preferences and on the left side, collapse PHP > Editor and click on Syntax Coloring.
Indentation & Spacing
As a programmer, I find non-indented code and/or excessive blank spaces a real pain to read. Thankfully, there is a good plugin to handle indentation and spacing, called AnyEdit. This plugin will allow us to automatically convert tabs into spaces so that if you decide to open a file on different editor the indentation is consistent, automatically remove extra white space at the end of each line and to automatically create a new line at the end of each file; which sometimes missing this extra line causes PHP to be displayed incorrectly.
AnyEdit Installation & Setup
Download AnyEdit from here or install the plugin directly from Eclipse by using this URL http://andrei.gmxhome.de/eclipse/ as the location. Make sure to download the version under Eclipse 3.3 - 3.5 plugins.
To setup AnyEdit go to Window > Preferences, then expand General > Editors and then click on AnyEdit Tools. I personally use the following settings. Under the Auto - Convert tab, tick these checkboxes: "Remove trailing whitespace", "Create new line at the end of the file" and "Convert tabs <-> spaces". Also, under Default convert mode on save select the Tabs to spaces radio button. Under the Convert tab, type 2 for the "Tab width/number of space for tab" and tick the "Remove trailing whitespace while 'convert' actions".
Text Editor Setup
Go to Window > Preferences, then expand General > Editors and the click on Text Editors. Under "Displayed tab width" type 2, and tick these checkboxes: "Insert spaces for tabs" and "Show print margin", also set the "Print margin column" to 80.