2

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

1 Answer 1

2

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.

1
  • Doesn't work :(
    – traveh
    Commented Apr 4, 2017 at 7:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .