How can I change the default app for opening text files on Arch Linux?

September 14, 2026 4 answers
Asked by MellowCactus47
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?

Answers

BrightOwl_26
You can also check your desktop environmentโ€™s preferred applications settings and change the default text editor there.
Reply to this answer
QuietMaple19
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.
Reply to this answer
VelvetHarbor8
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.
Reply to this answer
KDEpioneer55
In KDE, right-click the file, open Properties, and use the โ€œOpen Withโ€ section to replace Firefox with your preferred editor.

MellowCactus47: 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.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions