Skip to content

Instantly share code, notes, and snippets.

@icanswiftabit
Last active January 7, 2017 17:35
Show Gist options
  • Save icanswiftabit/277b9c5d503169d48f5f9f9bd64414f5 to your computer and use it in GitHub Desktop.
Save icanswiftabit/277b9c5d503169d48f5f9f9bd64414f5 to your computer and use it in GitHub Desktop.
Set default program for text edition in macOS 10.11+
  • In terminal type
defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add \
'{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=<program bundle id>;}'

ex. for SublimeText 2

defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add \
'{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.2;}'
  • Restart machine and done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment