Replace TextEdit as the default text editor in MacOS Big Sur

Have you tried SwiftDefaultApps? It's a modern replacement for the old RCDefaults System Preferences pane.

https://github.com/Lord-Kamina/SwiftDefaultApps

Here are two screen shots of SwiftDefaultApps, the first showing Uniform Type Identifiers tab for public.plain.text with Sublime Text 2 set as the Editor, and the second showing the Applications tab and Sublime Text 2 with public.plain.text checked. (This works the same with Sublime Text 3 too.)

With these settings, any plain text file, with or without a .txt extension, will open in Sublime Text when double-clicked in Finder.

SwiftDefaultApps - Uniform Type Identifiers tab for public.plain.text

SwiftDefaultApps - Applications tab for public.plain.text


Historical Reference: RCDefaultApp @ web.archive.org: https://web.archive.org/web/20200312011847/http://www.rubicode.com/Software/RCDefaultApp/


I had the same problem on Big Sur 11.6.1 - Intel

I think it's due to mixed entries in ~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist

So I had previous sublime entries inside of it and I think that were the confusion was coming from.

I've checked the CFBundleIdentifier inside of the

/Applications/Sublime Text.app/Contents/Info.plist

In my case it says it's com.sublimetext.4 (depends on the version of the sublime you have installed.)

In my case I have been already using Sublime for some longer time with previous releases and also with previous MacOS releases.

This is what I did:

  1. Removed the ~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist
  2. Restart MacOS so the system recreates com.apple.launchservices.secure.plist
  3. As the current logged in user executed
defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add  '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.4;}'
  1. Restart MacOS
  2. Voalá, everything plain-text based is now being opened in sublime.