You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notepad++ ERB (for HTML) User Defined Syntax Language Highlighting
I used the User defined language feature of NPP to create some color lexing when working with ERB HTML template files.
I use black background so it's based on that. I post it here so any others might find it useful as a starting point. It will save you the trouble of inputting all the various keywords and delimiters.
On the keywords panel, those for HTML are on the right, Ruby and ERB on the left.
(On the right, top .. down are: HTML elements, HTML global attributes, HTML element specific and other attributes, and lastly: events.)
To use with Notepad++, remove the temporary ".txt" from the file name.
In NPP, open the Language > Define your language... dialog.
At the top is a "Import..." button. Browse to where the xml file is, and choose OK.
You should now have a "ERB-HTML" item at the bottom of the Language menu.
You can select this lexing for any file you wish. It may have "erb" set as a filename so you may see new erb files opened afterward matching the lexing.
Just a note of caution. The Define your own lexing feature does have bugs.
Sometimes certain words of one type get shown in another types color.
I noticed when using my "Markdown" definition that sometimes the NPP save button does not know that I've modified the file. So I have to do a "Save As..." and overwrite, instead of a plain "Save".
The text was updated successfully, but these errors were encountered:
Notepad++ ERB (for HTML) User Defined Syntax Language Highlighting
I used the User defined language feature of NPP to create some color lexing when working with ERB HTML template files.
I use black background so it's based on that. I post it here so any others might find it useful as a starting point. It will save you the trouble of inputting all the various keywords and delimiters.
On the keywords panel, those for HTML are on the right, Ruby and ERB on the left.
(On the right, top .. down are: HTML elements, HTML global attributes, HTML element specific and other attributes, and lastly: events.)
userDefineLang_ERB-HTML.xml.txt
To use with Notepad++, remove the temporary ".txt" from the file name.
In NPP, open the Language > Define your language... dialog.
At the top is a "Import..." button. Browse to where the xml file is, and choose OK.
You should now have a "ERB-HTML" item at the bottom of the Language menu.
You can select this lexing for any file you wish. It may have "erb" set as a filename so you may see new erb files opened afterward matching the lexing.
Just a note of caution. The Define your own lexing feature does have bugs.
The text was updated successfully, but these errors were encountered: