I'd like to edit the syntax highlighting for PHP in Notepad++:
$_
in a different color than variables starting with only $
{} () []
in different colors than operators like & =
Is it possible to change the highlighting to be this in-depth? How?
To configure syntax highlighting, click on “Language” in the top bar, then click the letter the language starts with, and then the language. If you want to define your own language, click on “Language” again, then click on “User Defined Language”, third from the bottom, and then click “Define your language”.
The highlight_string() function outputs a string with the PHP syntax highlighted. The string is highlighted by using HTML tags. The colors used for syntax highlighting can be set in the php. ini file or with the ini_set() function.
Like other text editors, Notepad++ (which is recommended by the basic tutorial) uses a system called Syntax Highlighting which helps in coding by visually identifying different parts of code with color.
Style Configurator -> Global Styles -> Selected text colour. This is basically going to change the color of the selected text.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With