Skip to main content

Another option is to use duti (https://github.com/moretension/duti).

Run brew install duti, save a filetype like this as:

duti -s com.sublimetext.4 public.plain-text all

The changes should be applied immediately, so you don't have to restart like when editing com.apple.LaunchServices.plist.

To also change the default application for executable scripts with no filename extension, add a line like this:

duti -s com.sublimetext.4 public.unix-executable all

Some files are also considered 'public.data', not 'public.plain-text', so you can do this as well:

duti -s com.sublimetext.4 public.data all
Lri
  • 106.4k
  • 19
  • 230
  • 283