Adding Keywords to Ruby Syntax Highlighting for Notepad++

Adding Keywords to Ruby syntax highlighting for Notepad++

Notepad++ provides an interface for this so you should use that rather than modify application files.

Go to Settings > Style Configurator..., visit the Ruby tab, choose the INSTRUCTION category, and add the two keywords there so it looks like this:

Sample Image

With the easier, interface-provided method out of the way, the real mistake you made is that you modified the langs.model.xml file, but forgot to rename it such that it overwrites the original lang.xml. The *.model.xml files are default example files.

And with that said, you can still modify the langs.xml file so that the new keywords appear for all Notepad++ themes, but make sure to:

  • Save in %AppData%\Notepad++ instead of %ProgramFiles%\Notepad++ so updating the editor doesn't revert your changes by overwriting program files (assuming %AppData% is being used)

  • Back up the original langs.xml file, just in case you want to revert to the default

Notepad++ syntax highlighting: How to declare `number` and `boolean` as non-keywords for JavaScript?

For number it turned out to be quite easy - you can change your theme specific style configuration: Go to Settings > Style Configurator and select Language: JavaScript and Style: Keyword then under User-defined keywords you can remove number.

As for the word boolean it turned out that boolean (in contrast to number) is (or was) indeed a keyword in JavaScript (see: https://www.w3schools.com/js/js_reserved.asp) - thanks a lot to Toto for that clarification (see comments above).
To be more precise is was a "future reserved word" in JavaScript versions before ECMAScript5 (see here: Section "Removed Reserved Words" in https://www.w3schools.com/js/js_reserved.asp and https://262.ecma-international.org/11.0/#prod-ReservedWord). In modern JavaScript boolean is not a reserved word any longer.

Notepad++ not syntax highlighting my files

You could try going to Language > H > Html and that should highlight stuff.

Notepad++ syntax highlighting for *.map

I am sure this has been answered somewhere over here or at SuperUser, can't find it right now.

Go to Languages > Define Your language > select your defined language from the User Language dropdown and set the Ext field with map.

I have this setup for *.log files :
npp screenshot

To update the highlighting rules select the tabs Keywords Lists , Comment & Number etc and update the rules.

Update --

Okay found it here : How can I tell Notepad++ to always use a particular language with a particular file extension



Related Topics



Leave a reply



Submit