Set TextMate 2 as default editor

2

1

How do I set TextMate 2 as default editor for text files in Mac OSX Sierra?

According to the 2nd answer in https://stackoverflow.com/questions/9370584/mac-os-x-set-textmate-as-default-text-editor I tried:

defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.macromates.textmate;}'

But it doesn't seem to work - when I open a file with a .txt extension it opens in TextEdit.

Note that I'm not looking for a manual solution like the accepted answer in https://stackoverflow.com/questions/9370584/mac-os-x-set-textmate-as-default-text-editor

traveh

Posted 2017-04-02T08:46:16.757

Reputation: 554

Answers

1

You need to write to com.apple.LaunchServices/com.apple.launchservices.secure:

defaults write com.apple.LaunchServices/com.apple.launchservices.secure \
    LSHandlers -array-add \
    '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.macromates.textmate;}'

Then log out for the change to take effect.

grg

Posted 2017-04-02T08:46:16.757

Reputation: 1 499

Doesn't work :( – traveh – 2017-04-04T07:25:35.843