Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quick way to set custom syntax highlighting in Eclipse

I know I'm not the first to need this. I am working on an in house created codebase and I would like to apply highlighting to it within Eclipse. In Notepad++ I can set language for the file I'm looking at. Is there any way to do this for Eclipse?

The code I'm working on would use the same syntax styling as C++.

like image 681
Donovan Avatar asked May 31 '12 15:05

Donovan


2 Answers

As Andrew Eisenberg said, go to Window --> Preferences --> General --> Editors --> File Associations and ensure your choices for editor for each file type are correct according to your desires.

However, for Eclipse CDT most of your file types are set in Preferences --> C/C++ --> File Types instead.

Also, like he said, you can use the right-click menu to choose your own editor, including an external system editor, such as Sublime Text 3, Atom, Visual Studio Code, Notepad++, etc.
Right click on the file --> Open With --> Other... --> choose an "Internal editor" or "External program" to your liking, optionally checking the box at the bottom to make this the default choice next time.

like image 55
Gabriel Staples Avatar answered Sep 20 '22 08:09

Gabriel Staples


Your best bet is to go to Preferences -> General -> Editors -> File associations. Add the file extension of the thing you are trying to open and add the C++ editor as the associated default editor.

If there is no file extension, then things are a little harder. Instead of double-clicking to open the file, right-click -> Open with... -> other -> C++ editor. This will remember your choice for that file only.

like image 30
Andrew Eisenberg Avatar answered Sep 20 '22 08:09

Andrew Eisenberg