I could not find an existing bundle for OpenCV, so you'll have to create your own language grammar:
Textmate Manual - Language Grammars
So there are 2 suggestions;
The first is to hack your C++ language:
Bundles
-> Bundle Editor
-> C
->Language Grammars
->C++
insert this code, perhaps after the {include= 'source.c';},
line
{name = 'keyword.control.c++';
match = '\b(Mat|Range|Rect)\b';
},
You then include all of the keywords you want recognized, just as I've demonstrated with Mat
, Range
, and Rect
.
Or
You could create your own language bundle. Following the above manual, this is an untested grammar that might work.
{
scopeName = 'source.opencv';
fileTypes = ( );
foldingStartMarker = '\{\s*$';
foldingStopMarker = '^\s*\}';
patterns = (
{
name = 'meta.function';
match = '\b(Mat|Range|Rect)\b';
},
);
}
Mind you, a proper bundle would create a new language with the correct the scope selector.
One perk here, is if you create the bundle successfully you could have it added to the official bundles list, saving others the effort. If you get that far, reachout to the mailing list to have it officially added.