To set file association stuff more easily than with the Finder GUI, you can run (with https://github.com/moretension/duti):
duti -s com.apple.textedit public.${whatever} all
Where ${whatever} is in {plain-text, json, source-code, ...}. I'm sure there's a way to automate this through parsing `lsregister -dump`, but have a script I run on every Mac I have that sets TextEdit as the default instead of XCode for a bunch of file types :-)