Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make an editor the default editor for all unknown files in Eclipse?

Tags:

eclipse

I regularly open files of different types in Eclipse. For many types, Eclipse uses the system editor by default. I don't want this to happen. I want Eclipse to use the built-in Text Editor for unknown file types. However all I can find are options to set the default editor for a certain file type, but not for all unknown ones. Is there an option to do this?

like image 271
Thomas Lötzer Avatar asked Aug 10 '11 07:08

Thomas Lötzer


People also ask

How do I change the default editor in eclipse?

Tip. You can set which Eclipse editor or external program to use to open a specific type of file based on its file extension. Just select Window→ Preferences→ Workbench→ File Associations, select the file type, and associate an editor or program with it (if nothing else, you can use Eclipse's default text editor).

How do I make text editor default?

In the main menu, click on Edit > Settings…. Select File editing from the menu on the left. Select Use system's default editor for text files from the Default editor option group. Click on OK.

How do I open all files in eclipse?

Press Ctrl + A to select all files. Click on open button.


2 Answers

I don't think you can do this in one swoop, however:

Windows > Preferences > General > Editors > File Association.

If you don't have a LOT of unknown file types, just type *.junk, *.punk, *.clunck and add Text Editor as the default editor.

Sadly you can't use *.* here.

like image 131
Ali Avatar answered Sep 22 '22 02:09

Ali


This issue with file associations is something that has always annoyed me with Eclipse. It is specially frustrating if you are trying to use Eclipse to edit files that don't have a file extension because then you can't even set a editor.

I searched over the Eclipse bug database and found my exact issue there. It was first reported in 2003 and up until now there is no solution for it. If you follow the long comment track over the years you will see that there is no way of setting a default editor for unknown file types. From what I gathered the problem boils down to eclipse not looking at the content of file to try to determine the type. Instead it fully depends on the file extension.

Some people have made suggestions for fixes but again nothing has come out of that. If you search the bug tracker DB you will find a lot more bugs created around this.

like image 22
jkysam Avatar answered Sep 22 '22 02:09

jkysam