I accidentally set Firefox as the application for opening my text files. Now double-clicking a plain-text file launches Firefox, which isn't useful for editing it. I tried looking through the settings but couldn't find a fix. What's the easiest way to choose a proper text editor and restore it as the default application on Arch Linux?
4 Answers
In KDE, right-click the file, open Properties, and use the “Open With” section to replace Firefox with your preferred editor.
Right-click a .txt file and choose “Open With.” Select the text editor you want, then enable “Always use this application for this file type.” After that, double-clicking text files should open them in the selected editor.
For a manual fix, edit ~/.config/mimeapps.list. Under [Default Applications], find the text/plain entry and replace Firefox’s desktop file with the desktop file for your chosen editor. The relevant desktop files are usually in ~/.local/share/applications or one of the system application directories.
You can also check your desktop environment’s preferred applications settings and change the default text editor there.

It seems to be associated with the last editor I opened rather than intentionally set to Firefox, but I’ll try changing it through the file properties.