Try adding an entry for text/plain
to the top of ~/.local/share/applications/mimeapps.list
:
[Default Applications]
text/plain=gedit.desktop
For this to work the file /usr/share/applications/gedit.desktop
needs to exist. If it doesn't, it sounds like your gedit
package is broken; try forcing a reinstall as suggested here.
Switching the Default GUI Text Editor
If instead you want to set a different text editor such as Geany as the "default", so that "Open With Geany" shows for all text files instead of "Open With Text Editor":
First, create a file named e.g. geany.desktop
in ~/.local/share/applications
(there are probably already several .desktop
files in there) with the following contents. This question can help with that.
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=geany
Name[en_US]=Geany
Exec=/usr/bin/geany
Comment[en_US]=Geany
Name=Geany
Comment=Geany
Icon=geany
Then, edit the ~/.local/share/applications/mimeapps.list
file and an entry for text/plain
at the top of [Default Applications]
:
[Default Applications]
text/plain=geany.desktop