I'd like to edit the syntax highlighting for PHP in Notepad++:
- To have variables starting with
$_
in a different color than variables starting with only $
- To have operators like
{} () []
in different colors than operators like & =
Is it possible to change the highlighting to be this in-depth? How?
This is Possible
In Notepad++, define a new language by clicking View > User-Defined Dialogue...
Give the language a name (e.g. myPHP). Set the ext (file extension abbreviation) to php. Define the color coding for the global variables and for the brackets, braces and parentheses, etc. Close the Dialoague.
That is all. The formatting for myPHP which conflicts with the formatting for PHP will override the formatting for PHP, i.e. if the file has a .php extension.
More information: Notepad++ Wiki
To edit the syntax highlighting in Notepad++
, follow these steps:
- Go to
Settings
, then Style
. The configurator dialog opens.
- Select language
php
- Select the style based on your criteria
- Save