hi there,
I'd like some advice on how to best change the default language for .txt to markdown (90% of my plaintext is in markdown and i find that in the other 10% the markdown language doesn't break anything really, either - try it out on TextMate's README, for example...)
at the same time i like to stay current with the svn repository, so simply making a copy of the markdown bundle in ~/Application Support/ TextMate/ wouldn't be viable either.
any suggestions?
best regards,
tom
btw. b8 looks really good! methinks it should be announced on versiontracker and such places! -- Tom Lazar http://tomster.org
On May 7, 2005, at 15:02, Tom Lazar wrote:
I'd like some advice on how to best change the default language for .txt to markdown [...]
To associate .txt with Markdown, from Terminal.app do (while TM is not running): defaults write com.macromates.textmate OakLanguageFileBindings '({name = "Markdown"; fileTypes = (txt); language = "0A1D9874-B448-11D9-BD50-000D93B6E43C";})'
If you want all new documents to open as Markdown, do: defaults write com.macromates.textmate OakDefaultLanguage '0A1D9874-B448-11D9-BD50-000D93B6E43C'
If you later regret this, just do: defaults delete com.macromates.textmate OakDefaultLanguage
In these examples the long string is the UUID of the language.
Also, in the first example you can set firstLineMatch to a regex instead of the fileTypes array (or you can set both).
btw. b8 looks really good! methinks it should be announced on versiontracker and such places!
Thanks -- well, I do have ~3 items that I _really_ would like/need to do before going back to official betas. But hopefully I'll have a productive weekend! :)
On May 7, 2005, at 3:17 PM, Allan Odgaard wrote:
[helpful stuff]
thanks Allan (and Brad), works like a charm!
also Allan: that bugfix in b8 concerning the subversion contextmenu (and others, I presume) works great. try as I might, I couldn't get it to break ;-) Very much appreciated!
best regards,
tom -- Tom Lazar http://tomster.org
On May 7, 2005, at 3:17 PM, Allan Odgaard wrote:
while that worked as advertised I also tried to associate files ending in '.css.dtml' as CSS (it's a Zope thang, dynamically generated CSS files, cool stuff...) and entered
defaults write com.macromates.textmate OakLanguageFileBindings '({name = "CSS"; fileTypes = (css.dtml); language = "4675F24E-6227-11D9-BFB1-000D93589AF6";})'
any idea why that didn't work? (I did quit and then restart TextMate)
thanks again,
tom --
Tom Lazar http://tomster.org
On May 7, 2005, at 16:42, Tom Lazar wrote:
Currently it uses only the last extension of the filename. I can probably change it to a prefix match. Don't know if just using “dtml” would suffice for your purpose?
Btw: OakLanguageFileBindings is an array, so you'd need either to list all your associations: '( { name = ...; }, { name = ...} )' or use the “-array-add” option to defaults.
E.g.: defaults write com.macromates.textmate OakLanguageFileBindings -array-add '{name = "CSS"; fileTypes = (dtml); language = "4675F24E-6227-11D9-BFB1-000D93589AF6";}'
On May 7, 2005, at 8:08 PM, Allan Odgaard wrote:
Currently it uses only the last extension of the filename.
ah, ok.
I can probably change it to a prefix match.
that woud be great! (at least for all the Zope developers among the TM users...)
Don't know if just using “dtml” would suffice for your purpose?
come to think of it: for this particular project: yes... (in fact, that's what i'll do for now...) but otherwise: no...
yeah, I realized that, when my CSS binding 'kicked out' my previous markdown binding... but thanks for mentioning the -array-add option - I didn't know about that one.
sometimes I feel guilty for stealing so much of your coding time ;-)
thanks again,
tom
Tom Lazar http://tomster.org
Tom,
I agree with you. I use markdown for a number of things myself and most of my .txt files are really markdown.
Here is a hint that Allan sent out to the Bundle Developers list after I erroneously committed a change to the markdown language that caused it to claim text files.
So far its worked great for me.
Brad
On May 7, 2005, at 8:02 AM, Tom Lazar wrote: