[TxMt] Re: list of all file types for -t

Christian Rosentreter karibu at gmx.net
Mon Apr 22 23:04:21 UTC 2019


Hi there,

> On 23 Apr 2019, at 12:01 AM, Dr Eberhard W Lisse <el at lisse.na> wrote:
> 
> Yes, and no.
> 
> I would like to know which (common) ones are possible, or how I can find
> that (which ones are installed/available) out, so that if I use "mate -"
> in a pipe I can "load" the required bundle and make use of its
> facilities without having to resort to selecting filetype with the
> mouse.
> 
> Probably something of use to others as well.


Maybe use something like this insane one-liner:

find ~/Library/Application\ Support/TextMate/Managed/Bundles -depth 1 -name '*.tmbundle' -exec bash -c 'tput bold; echo -n "$(defaults read "{}/info.plist" name): "; tput sgr0; echo $(if cd "{}/Syntaxes" 2>/dev/null; then for syntax in *.plist *.tmLanguage; do if [ -f "${syntax}" ]; then /usr/libexec/PlistBuddy -c "Print :fileTypes" "${syntax}" 2>/dev/null | grep -v "[\{\}]"; fi; done; fi)' \;


Actually, please don't try that. You've been warned! :-) But probably something like this could be done properly in a shell script. Just scan the available bundles and extract the required information directly. I'm not sure what "filetype" the mate command actually wants (maybe using the scopeName from the syntax file would be the right choice?).

Just providing some wild ideas…


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5284 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20190423/f8f2d4de/attachment-0001.p7s>


More information about the textmate mailing list