I accidentally set Firefox as the application for opening my text files. Now, whenever I open one, it launches Firefox, which isn't useful for editing the file. I tried changing the setting but couldn't get it working. What's the easiest way to choose a proper text editor and make it the default for text files?
3 Answers
If you're using a desktop environment with a preferred-applications settings panel, you can change the default text editor there. The exact menu name depends on whether you're using KDE, GNOME, Xfce, or another desktop environment.
On KDE, right-click the file, open Properties, and use the “Open With” section to replace Firefox with your editor. If the graphical option doesn't stick, check your MIME associations in `~/.config/mimeapps.list`. Under `[Default Applications]`, find the `text/plain` entry and set it to the editor's `.desktop` file, such as `mousepad.desktop`, `kate.desktop`, or another editor installed on your system.
Right-click a text file, choose “Open With…” or “Properties,” then select the text editor you want and enable the option to always use it for that file type. After that, double-clicking text files should open them in the editor you chose.

I think the file is still associated with the last editor I used rather than Firefox being intentionally configured. I'll try changing the association through the file properties and then check the MIME settings if needed.