[TxMt] Re: Different Themes based on file type

Allan Odgaard mailinglist at textmate.org
Mon Aug 26 08:01:37 UTC 2019


On 23 Aug 2019, at 16:14, Umberto Cerrato wrote:

> I found a solution.
>
> [ *{c,cpp} ]
> tabSize = 4
> theme   = 71D40D9D-AE48-11D9-920A-000D93589AF6

The thing in the square brackets is a [file system 
glob](https://macromates.com/textmate/manual/references#glob-string), 
which is what you currently use, but the one above also match files like 
`fooc` and `foocpp` (as there is no dot in the glob).

So instead you should want to use:

     [ *.{c,cpp} ]
     tabSize = 4
     theme   = 71D40D9D-AE48-11D9-920A-000D93589AF6

As an alternative to a file system glob, it is possible to use a 
“scope selector” which would be `source.c` and `source.c++`, for 
example:

     [ 'source.c, source.c++' ]
     tabSize = 4
     theme   = 71D40D9D-AE48-11D9-920A-000D93589AF6

The advantage with this is that it will target all C and C++ files, even 
if they do not have a `.c` or `.cpp` extension.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macromates.com/textmate/attachments/20190826/8b644148/attachment.html>


More information about the TextMate mailing list