Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad++ new keywords defined with regex for the Styler configuration

If I want to add new keywords in the Styler configuration for the "c" language suppose, and I have my custom defined data type. for eg:

uint_8 a;
uint_16 b;
uint_32 c;
uint_12bla bla;*

is it possible to add somehow the keywords, instead of adding explictly harcoding each keywords, as a regex, (uint_\d+\w*) ?

mostly benifitted, incase I have thousands of intrinsics starting with naming format and I want to highlight all of them. eg:

vector_intrinsic_add(a,b);
vector_intrinsic_mul(a,b);
vector_intrinsic_shit_right(a,b);
vector_intrinsic_shift_left(a,b);
vector_intrinsic_fill_zero(a);
vector_intrinsic_do_bla(a,b);
like image 245
Aravind Nadumane Avatar asked Oct 03 '22 04:10

Aravind Nadumane


1 Answers

In the Styler configurator, you can declare a keyword "group" to have the "Prefix" property. That means that the patterns which match the group will still be colored if they have extra text following them.

If you're fairly confident that anything starting with uint_|vector_intrinsic_ should be highlighted, then go ahead and allocate a group for that purpose. Beware that you only get 4 groups, so you may need to shuffle some keywords around to get the configuration you want.

Source: http://npp-community.tuxfamily.org/documentation/notepad-user-manual/languages/user-defined-languages

like image 74
Austin Hastings Avatar answered Oct 13 '22 08:10

Austin Hastings