Replace TextEdit as the default text editor application for opening plain text files and files with no extensions on macOS.
Run the following command in the Terminal to find the bundle identifier for your desired text editor application:
$ osascript -e 'id of app "Visual Studio Code"'
com.microsoft.VSCode
$ osascript -e 'id of app "Sublime Text"'
com.sublimetext.3