I was looking for a way to make BBEdit the default text editor for _all_ text files.
More specifically, I wanted to be able to use 'open -t' and have the file open in BBEdit.
Just to refresh your memory, quoting from `man open`:
-t Causes the file to be opened with the default text editor, as determined via LaunchServices
I went searching on the web for this, but 99% of what I saw came down to "Select the file in Finder, choose 'Get Info' and tell it to 'Change All' of those file extension types to open with BBEdit!' Of course that wasn't helpful because I already knew that, but what about files with _no_ extension? And what about 'open -t'?
In case anyone else is curious, here is the command that I used:
defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add \
'{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.barebones.bbedit;}'
After that, I used `open -t ~/.ssh/authorized_keys` and the file opened in BBEdit. I didn't even have to logout/login or reboot, as some had suggested.
(This was in the public beta 3 of Mojave, FWIW.)
I hope this might be of use to someone else… or possibly me, in the future, when I search the web for the answer to this question and find my own answer to it ;-)
Tj