[TxMt] Language based on path

dvlogic dvlogic at gmail.com
Wed Mar 26 17:41:53 UTC 2008


Is there a way to get TextMate to auto pick the file language based on the
file path?  

As an example, I have both matlab scripts and objective-c files each with
".m" extensions.  When the path is .../matlab/... I would like them to use
the Matlab language bundle otherwise use the Objective-C language bundle.

When I used to use emacs, I had a load hook that was able to parse the file
path and use the correct mode. 

Incidentally, I've added "firstLineMatch = '^[#%]+\s*.*[Mm]atlab.*';" to the
Matlab language which works if I start the file with a '% Matlab' comment -
this works for files I write, but not ones others write.  Maybe there is a
way to have a "filePathMatch = '.*\/matlab\/.*'" (or equivalent) in the
language?

Thanks,

-- d
-- 
View this message in context: http://www.nabble.com/Language-based-on-path-tp16308189p16308189.html
Sent from the textmate users mailing list archive at Nabble.com.




More information about the textmate mailing list