When we use Arduino with the IDE library file, We will find, some class name, function name and constant definitions are different from general text color.So how do our own library implement these keywords highlighted? Let me introduce, how to add keywords to Arduino IDE
1：Keyword description file path
There is a “keywords.txt ” under ArduinoIDE per database directory, this is the keyword description file. We can easily copy this file to our own database directory , and then edit.
2: Description rules
The figure above is an example of a keyword, each row contains the keyword name, TAB key (non whitespace), key type. The class name is KEYWORD1, will be highlighted as orange; function names is KEYWORD2, highlighted as brown, constant definition is KEYWORD3, the color is blue. Restart Arduino IDE ,these settings will take effect. ( note: You can not use spaces instead of TAB, otherwise this keyword set is invalid)
Leave a Reply
You must be logged in to post a comment.