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:
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 :
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
Accepts_Nested_Attributes_For Rails 4 Is Not Deleting
Rails: Switch Connection on Each Request But Keep a Connection Pool
How to Add Child Nodes in Nodeset Using Nokogiri
How to Profile Ruby 1.9.2 Scripts with Memory Allocation Reports
Define_Method: How to Dynamically Create Methods with Arguments
Generate Ssh Keypairs (Private/Public) Without Ssh-Keygen
Ruby: Build Failed (Macos 11.2 Using Ruby-Build 20210119) MAC Big Sur
What's the Difference Between Bundle.Setup and Bundle.Require
Model Using Modules in Rails Application
Unable to Load Gem Cocoa Pods While Creating Repo
Using Yield Inside Define_Method in Ruby
Bundler Puts My Gems in My Project Directory
How to Get a HTML Table Row with Capybara
How to Get a List of All Available Rake Tasks in a Namespace