Is there a simple, consistent way to change the color scheme of Eclipse editors? - eclipse

I'm going crazy trying to get all of the editors to look similarly. It looks like there's a different color editor option for each file type/code type, which means it takes FOREVER to customize the view.
Add to that: each code/file type color option seems to honor the default set in the generic options only if it feels like it (seems buggy).
I'm currently using Eclipse 3.4.1 (Ganymede).
Is there a version that is less buggy or is there a more consistent way to change the text colors?
Barring that, has anyone gotten a Zenburn-like color scheme in Eclipse that would be willing to share?

I'm working on an Eclipse plugin for this:
http://marketplace.eclipse.org/content/eclipse-color-theme
It's by no means complete, but it does work quite well already.

It sounds like there isn't currently a good way of doing this because of the way Eclipse was designed: there's not a good, flexible, inheritable syntax highlight framework to bring consistency to everything.
While you can export & import preferences as Wijnand Warren's answer states, and that does work... kind of... actually going in and editing the preference files to make sure that you're only sharing color information is probably a huge pain in the butt, so not simple. Also, that still leaves the problem of finding someone who has put in the effort & time to create the syntax coloring in the first place.
Also, every time you add a new type of structured text editor (new language per year anyone?), you'll have to go back into settings & edit the highlighting for that language as well.
I have no experience developing for the Eclipse platform, but if someone with more experience would be willing to point me in the right direction (documentation, explanation of how things fit together, etc.), please let me know.

I've searched high and low for an answer to the same question and have all but given up. It is not easy to change the color scheme because, as you said, each language has its own options buried deep in the Configuration tree.
I've read a little about why 'themes' aren't available, and it has something to do with the complexity of Eclipse's XML storage technique. I'm sorry that I can't provide a real solid answer, but I just wanted to let you know that you're not alone in your frustrations.

I've been looking for this too and after a bit of research found a workable solution.
This is based on the FDT editor for Eclipse, but I'm sure you could apply the same logic to other editors.
My blog post: Howto create a color-scheme for FDT
Hope this helps!

Install the color theme plugin from http://eclipse-color-theme.github.com/update. It already consists of some good themes that you can use.
Then just go to menu Window → Preferences → General → Appearance → color theme to apply the themes.
You can download more themes from http://www.eclipsecolorthemes.org.

Related

Filter entries in the Eclipse Variables View

Is there any built-in way (or plug-in) allowing for searching through the whole variable tree without manually expanding nodes?
I can't understand why isn't it done by default, just as I can't understand, why isn't search bar built into Variables view (browser style) and this unhandy, inconvenient dialog is opened instead. It makes my work, which is mainly debugging complex applications, a nightmare.
The Eclipse version is Luna, if it matters.
The watch expression feature is not what I want because it just doesn't work in this case, tried to fix it but none of the common ways to do that help me.
Such a feature has been requested earlier here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=170396
You may want to reopen this bug to state your interest in this enhancement. And if you have experience in developing Eclipse IDE plug-ins, I am sure the maintainers would be happy to review a patch.
I usually use Alt+Shift+Right/Alt+Shift+Left and Ctrl+Shift+I to select and inspect variables and expressions, but this certainly depends on personal preferences.

How to setup a new language IDE

At work we are using a proprietary language and to program we are using Notepad++ with a simple code highlight. That is really annoying so, what I want to do is to invest some time to setup a text editor or an existing IDE to support my language.
I've googled a lot and there are so many options and before starting to work I wanna ask to you what is the best choice.
What I want to do is to have, like an IDE, a syntax highlight, a window with the function list tree, with the local function variables inside the same subtree, maybe text autocomplete (if I type "pro" I would like to see the suggestion "procedure" and if I press enter it will write for me something like
procedure "name" {
--code--
}
with the cursor on "name" ready to change it.
etc etc...
Can you suggest me the right path to follow?
Is it to keep using Notepad++? With sourcecookifier? functionlist?
Or I have to change to another text editor?
Or there is some famous IDE like Eclipse, NetBeans etc that allow to easily add my own language?
PS. my language is pretty simple, I don't have complex structures, is Pascal-like. Something like that:
variable int xyz
PROCEDURE asd
BEGIN
END PROCEDURE asd
I would recommend you to stay with Notepad++ and extend it with some plugins and configuration. This would be fairly quick and easy to set up and still give a big win, even though you might not be able to get all the nice features of something like Eclipse. But since you already know the Notepad++ it wouldn't require learning an entirely new tool.
Some plugins that I have found useful
Function List
Light Explorer
XBrackets Lite
There are probably a lot more that can be useful to you.
Notepad++ also got some built in auto-completion functionality that can be enabled in the settings.
Have you evaluated Eclipse XTEXT ?
What is Xtext?
Xtext is a framework for development of programming languages and domain specific languages.
The only IDE I have used for the last few years is Eclipse. There are lots of other IDEs available, also notable and popular is Netbeans. There are many others. It's important to note that all IDEs have their fans, but I can only speak to Eclipse.
Eclipse is a platform, which means it is an application on which you can build other applications. Eclipse provides a framework which you can customize and extend to produce a working application. It takes care of the user interface, preferences storage, modularisation using OSGi, and lots of other things.
Eclipse has facilities to support what you're looking for:
Syntax highlighting in the editor.
The Outline View provides function and variable listing in a tree
Autocompletion and Suggestions (activated by hitting ctrl-space)
Code Templates to fill out files and procedures etc.
The disadvantage is that customising and extending Eclipse to do what you want isn't trivial. Having written a language debugger for Eclipse, I can tell you that leveraging Eclipse's platform helped enormously, but there's a learning curve. You'd essentially have to be coming up with a new set of plugins to provide your highlighting, outlining, autocomplete suggestions and templates (I'm not sure if template support is built into the platform or not).
So I would say, unless you can find some sort of extensible editor for Eclipse - I know Aptana is extensible for tag-based markup - you are probably as well staying with your existing tooling.
Do explore the other IDEs though - I've heard good things about IDEA as well as Netbeans. :)
Good luck!
I can recommend SynWrite editor. Good support for external languages, fully customizable. (Editor of new lexers is there)

How to disable this Netbeans highlighting?

I'm not sure if StackOverflow is the right site for this question but i don't think I'd get better help from other than developers here.
Basically Netbeans keeps highlighting scripting in ERB or HTML files. I tried to disable many things in tools -> options -> fonts & colors. But none worked.
Any one knows how to get rid of that? It appears on all themes.
Old Queston, but still relevant, (and in other IDEs as well). For Netbeans v8, you will find most of the old links / themes unusable. But there is a way.
Go to Tools -> Plugins and search 'theme' and you will get "Dark Look And Feel Themes"
The default that came up after a reboot did NOT have the ugly highlighting on scripts, and it is easy on the eyes (unlike the default theme), plus it has good color-highlighting for "html.erb" files. The controller code could use some work on the highlighting, but I can live with it.
And before anyone points it out - yes, official support was dropped by NB for Ruby. The community, however, has done a great job via plugins keeping the Ruby/Rails support working.

Reverse Display for Eclipse

Does anyone know of an easy way to switch Eclipse into a reverse display without having to manually change all the color settings, similar to Emacs --reverse-video?
Thanks!
-Max
Addendum: I encountered a few more interesting articles around this topic. Nothing for Eclipse though.
Slashdot: Best Color Scheme For Coding, Easiest On the Eyes?
Coding Horror: Is Your IDE Hot or Not?
Zenburn for Konsole
Probably easiest to use someone else's preferences and import then modify them, I'm not aware of a way other than to manually configure the colours - it would be nice if it shipped with pre-defined themes. (note: I'm still on Europa)
Or: use a window manager that supports that. I use eclipse on linux, wm=compiz
Inversion is always a mere +N (aka. Windows+N) away
Now, I bet there are equivalents in windows (why not?)
Not really but try installing Eclipse Color Theme for easy theme editing

Getting Started with an IDE?

Having programmed through emacs and vi for years and years at this point, I have heard that using an IDE is a very good way of becoming more efficient.
To that end, I have decided to try using Eclipse for a lot of coding and seeing how I get on.
Are there any suggestions for easing the transition over to an IDE. Obviously, some will think none of this is worth the bother, but I think with Eclipse allowing emacs-style key bindings and having code completion and in-built debugging, I reckon it is well worth trying to move over to a more feature-rich environment for the bulk of my development worth.
So what suggestions do you have for easing the transition?
Eclipse is the best IDE I've used, even considering its quite large footprint and sluggishness on slow computers (like my work machine... Pentium III!).
Rather than trying to 'ease the transition', I think it's better to jump right in and let yourself be overwhelmed by the bells and whistles and truly useful refactorings etc.
Here are some of the most useful things I would consciously use as soon as possible:
ctrl-shift-t finds and opens a class via incremental search on the name
ctrl-shift-o automatically generates import statements (and deletes redundant ones)
F3 on an identifier to jump to its definition, and alt-left/right like in web browsers to go back/forward in navigation history
The "Quick fix" tool, which has a large amount of context-sensitive refactorings and such. Some examples:
String messageXml = in.read();
Message response = messageParser.parse(messageXml);
return response;
If you put the text cursor on the argument to parse(...) and press ctrl+1, Eclipse will suggest "Inline local variable". If you do that, then repeat with the cursor over the return variable 'response', the end result will be:
return messageParser.parse(in.read());
There are many, many little rules like this which the quick fix tool will suggest and apply to help refactor your code (including the exact opposite, "extract to local variable/field/constant", which can be invaluable).
You can write code that calls a method you haven't written yet - going to the line which now displays an error and using quick fix will offer to create a method matching the parameters inferred from your usage. Similarly so for variables.
All these small refactorings and shortcuts save a lot of time and are much more quickly picked up than you'd expect. Whenever you're about to rearrange code, experiment with quick fix to see if it suggests something useful.
There's also a nice bag of tricks directly available in the menus, like generating getters/setters, extracting interfaces and the like. Jump in and try everything out!
One thing that helped me transition from Emacs to other IDEs was the idea that IDEs are terrible editors. I scoffed at that person but I now see their point.
An editor, like Emacs or Vim, can really focus on being a good editor first and foremost.
An IDE, like Visual Studio or Eclipse, really focuses on being a good project management tool with a built in way to modify files.
I find that keeping the above in mind (and keeping Emacs handy) helps me to not get frustrated when the IDE du jour is not meeting my needs.
If you've been using emacs/vi for years (although you listed both, so it seems like you may not be adapted fully to one of them), using said editor will probably be faster for you than an IDE. The level of mind-meld a competant emacs/vi user can achieve with a customized setup and years of muscle memory is astounding.
Some free ones:
XCode on the Mac
Eclipse
Lazarus (Open Source clone of Delphi)
Visual Studio Express
Editions
Try making a couple of test applications just to get your feet wet. At first, it will probably feel more cumbersome. The benefits of IDEs don't come until you begin having a good understanding of them and their various capabilities. Once you know where everything is and start to understand the key commands, life gets easier, MUCH easier.
I think you'll find IDE's invaluable once you get into them. The code complete and navigation features, integrated running/debugging, and all the other little benefits really add up.
Some suggestions for starting out and easing transition:
- start by going through a tutorial or demonstration included with the IDE documentation to get familar with where things are in the GUI.
- look at different kinds of sample projects (usually included with the IDE or as a separate download) for different types of areas you may be coding (web applications, desktop applications, etc) to see how they are laid out and structured in the IDE.
- once comfortable, create your own project from existing code that you know well, ideally not something overly complex, and get it all compiling/working.
- explore the power! Debug your code, use refactorings, etc. The right click menu is your friend until you learn the keyboard shortcuts just to see all the things you can do. Right click different areas of your code to see what is possible and learn (or re-map) the keyboard shortcuts.
Read the doc...
And see what shortcuts/keybindings equivalents are with your familiar ones. Learn the new ones...
Old question, but let me suggest that in some circumstances, something like Notepad++ might be appropriate for the OP's situation which may be encountered by others. Especially if you are looking for something lightweight, Notepad++ can be part of a developer's arsenal of tools. Eclipse, Visual Studio and others are resource hogs with all their automagic going on and if you are looking to whip out something pretty quick with a whole bunch of keyboard shortcuts and the like or if you are interested in viewing someone else's source, this can be quite useful. Oh yeah, and it is free too.