##要我改下面这个文件, 但是, 我就没找到这个文件.
default application for public.plain-text in
~/Library/Preferences/com.apple.LaunchServices.plist
defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=xxxType;LSHandlerRoleAll=xxx.yyy.sublime;}'
defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.apple.textedit;}' '{LSHandlerContentType=public.unix-executable;LSHandlerRoleAll=com.apple.textedit;}'
Restart to apply the changes (logging out and back in isn't enough).
#据说直接运行这个是可以的.
defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.3;}'
defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.macromates.textmate;}' '{LSHandlerContentType=public.unix-executable;LSHandlerRoleAll=com.macromates.textmate;}'
#这个貌似没有效果, 反正我还没有重启机器.
#确实没用, 因为: This answer is for Mavericks and earlier.