[TxMt] Re: How to force grammar per file?

Allan Odgaard mailinglist at textmate.org
Fri Mar 16 06:10:37 UTC 2012


On 13/03/2012, at 11.41, Brandon Fryslie wrote:

> […] Can I force TextMate 2 to use Markdown for all .txt files by default while allowing me to selectively change some .txt files to other grammars, without changing the default grammar for all files of that type?

You can set fileType in .tm_properties which can target folders and file globs. E.g.:

    [ *.txt ]
    fileType = "text.html.markdown"

    [ Documents/*.txt ]
    fileType = "text.plain"




More information about the textmate mailing list