Skip to main content
format to visually split up older/newer answers, avoid side-scroll
Source Link

SetTo set Sublime Text as the default handler for public.plain-text:

Mavericks (10.9) and earlier

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

This answer is for Mavericks and earlier.

 

Yosemite (10.10) and later

For Yosemite and later, useUse 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.sublimetext.3;}'

Remember to restart to pick up the changes.

Set Sublime Text as the default handler for public.plain-text

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

This answer is for Mavericks and earlier.

For Yosemite and later, use 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.sublimetext.3;}'

Remember to restart to pick up the changes.

To set Sublime Text as the default handler for public.plain-text:

Mavericks (10.9) and earlier

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

Yosemite (10.10) and later

Use 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.sublimetext.3;}'

Remember to restart to pick up the changes.

Set Sublime Text as the default handler for public.plain-text

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

This answer is for Mavericks and earlier.
 

For Yosemite and later, use For Yosemite and later, use comcom.apple.LaunchServices/com.apple.launchservices.secure..

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

Remember to restart to pick up the changes.

Set Sublime Text as the default handler for public.plain-text

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

This answer is for Mavericks and earlier.
 For Yosemite and later, use com.apple.LaunchServices/com.apple.launchservices.secure.

Set Sublime Text as the default handler for public.plain-text

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

This answer is for Mavericks and earlier.

For Yosemite and later, use 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.sublimetext.3;}'

Remember to restart to pick up the changes.

replaced http://apple.stackexchange.com/ with https://apple.stackexchange.com/
Source Link

Set Sublime Text as the default handler for public.plain-text

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

This answer is for Mavericks and earlier.
For Yosemite and later, use com.apple.LaunchServices/com.apple.launchservices.secure.For Yosemite and later, use com.apple.LaunchServices/com.apple.launchservices.secure.

Set Sublime Text as the default handler for public.plain-text

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

This answer is for Mavericks and earlier.
For Yosemite and later, use com.apple.LaunchServices/com.apple.launchservices.secure.

Set Sublime Text as the default handler for public.plain-text

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

This answer is for Mavericks and earlier.
For Yosemite and later, use com.apple.LaunchServices/com.apple.launchservices.secure.

added 183 characters in body
Source Link
grg
  • 205.6k
  • 45
  • 364
  • 496
Loading
oops
Source Link
grg
  • 205.6k
  • 45
  • 364
  • 496
Loading
Source Link
grg
  • 205.6k
  • 45
  • 364
  • 496
Loading