You did not state which desktop environment you are using - that makes a difference. If xfce go to Settings Manager and somewhere there you can choose default applications. In Thunar (the xfce File Manager) you can also force it to load a specific editor for .txt files, or other files with suffixes that are obviously text.
If using KDE, use Control Center, KDE Components, Component Chooser (set things up there) and then File Associations and set up text file associations there.
For command line editor settings check what it is with "echo $EDITOR". You can change it to whatever text mode editor you like by changing the $EDITOR environment variable in your ~/.bashrc file.