Hi all,
I've been using TextMate for a while but I have recently started looking at some matlab scripts that I am porting over to C(Obj-C). The only problem is TextMate keeps coloring the .m matlab files using the C/Obj-C syntax coloring rather than the coloring provided by a Matlab bundle I have installed. Since I am editing files in both at the same time, Matlab and C, what would you recommend is the easiest way to get my .m matlab files to use the Matlab bundle coloring and my .m Obj-C files to use the C syntax coloring?
Thanks
Craig Yoshioka wrote:
TextMate keeps coloring the .m matlab files using the C/Obj-C syntax coloring rather than the coloring provided by a Matlab bundle
I had the same problem - how I solved it was by adding a first line match to the Matlab language that looks for a first line indicating its a Matlab file - It requires that each of my Matlab scripts have the first line as '% Matlab'. I keep the default .m extension as obj-c.
In the MATLAB language (in the bundle editor), add the following:
firstLineMatch = '^[#%]+\s*[Mm]atlab.*';
-- dv