On Ubuntu 23.04, I have installed Gedit alongside the default Text Editor (gnome-text-editor).
I want to keep gnome-text-editor, but I would like most text files to open in gedit.
I have added the following to ~/.config/mimeapps.list
, but it does not work-- if I click on a *.txt
file in Nautilus, it still opens in gnome-text-editor. What am I doing wrong in the following file?
# Separate *.desktop files with a ";"
[Default Applications]
application/octet-stream=org.gnome.gedit.desktop
application/xml=org.gnome.gedit.desktop
application/json=org.gnome.gedit.desktop
text/x-patch=org.gnome.gedit.desktop
application/javascript=org.gnome.gedit.desktop
text/x-csrc=org.gnome.gedit.desktop
text/markdown=org.gnome.gedit.desktop
[Added Associations]
application/octet-stream=org.gnome.gedit.desktop
application/xml=org.gnome.gedit.desktop
application/json=org.gnome.gedit.desktop
text/x-patch=org.gnome.gedit.desktop
application/javascript=org.gnome.gedit.desktop
text/x-csrc=org.gnome.gedit.desktop
# Override R Studio mime types listed in /usr/share/applications/rstudio.desktop
text/x-tex=org.gnome.gedit.desktop
text/x-markdown=org.gnome.gedit.desktop
text/html=org.gnome.gedit.desktop
text/css=org.gnome.gedit.desktop
text/javascript=org.gnome.gedit.desktop
text/x-chdr=org.gnome.gedit.desktop
text/x-csrc=org.gnome.gedit.desktop
text/x-c++hdr=org.gnome.gedit.desktop
text/x-c++src=org.gnome.gedit.desktop
text/markdown=org.gnome.gedit.desktop
It looks like I was missing a very important mapping:
This took care of opening most text files in Gedit.
I also added a couple of other mappings (to open XML and Python files in Gedit):