I've always liked PHP's default syntax highlighting, that is to say the color
scheme used by
I've often found myself easily grokking code examples on
when, say, looking up the parameter order for something like
only to suffer some frustration once going back to Gedit.
Here's the thing, syntax highlighting is supposed to help prevent syntax errors (obviously) and aid programmers in finding what they're looking for in very large amounts of code. I didn't understand what was causing my frustrations with Gedit until recently when I realized its default color scheme is terrible.
Let's take a look at it...
Firstly, if the aim is to help prevent syntax errors, then errors must be clearly indicated as such by some means. Red text should, therefore, never be used in syntax highlighting schemes for anything other than errors, such as spelling errors and in advanced text editors -- of which Gedit is sadly not one, and most are not -- syntax errors such as calls to undefined variables, functions or uninstantiated classes should be indicated by red text or red underline. Red is the most useful and expected color to indicate errors, red should not be used to indicate function and class definitions, as is being done in the above screencap.
I also notice an unnecessary use of bold font for "class", "public", "function", and "for", which I have yet to find useful. However, Gedit does share this oddity with Wikipedia, GNU Nano, GNU Emacs, and even GitHub, so perhaps this kind of syntax highlighting is simply common among text editors.
Gedit's default syntax highlighting color scheme also poorly aids programmers in finding what they're looking for. For example, function and class names as well as constants are colored black, and therefore hard to find. If a programmer is defining or looking for a specific variable they should be able to simply skim over the source code tree looking for text of a certain color, allowing them to focus on or ignore the defining of functions, classes, constants and likewise calls to functions, classes, constants and variables. Gedit's default color scheme fails to do this well, for every language. However, GNU Nano is by far the worst offender.
Admittedly, the default PHP color scheme is only marginally better than Gedit's default, as variables, integers, floats, functions, and classes all use the same color. However, that isn't a deal breaker as the idea behind it -- as far as I can tell -- is that things the programmer defines like variables, functions, classes, and constants are of one color, the defining method ($, function ..., class ..., define) are of another color and the values of things like variable strings, echoes, and arrays are of yet another color... sadly red.
With that said, here are three Gedit color schemes that mimic PHP's default.
(User Contributed Notes) section
Extract the files to the hidden directory
Start or restart Gedit.
Select "PHP Default" from the "Color Scheme" list in the "Font & Colors" tab under Preferences.
Enjoy! Happy hacking!
|* Curly braces aren't colored, there doesn't appear to be an option to define a color for curly braces.|