Tabs management in Eclipse

Among many blog posts and articles on „Eclipse Tips & Tricks” I haven’t found any related to effectively managing tabs and closing unused ones. I decided to write one myself as it is an issue developers face every day.

Why close unused tabs?

If it comes to tabs management, I’ve met two types of people:

  • Those who close unnecessary tabs once in a while
  • Those who don’t care and work with a ridiculous amount of open tabs (I’ve seen over 100 tabs open in Eclipse!)

Regrettably, the second group seem to be larger. The explanation is simple: Opening a fresh tab comes much easier than closing an old one. You need to open new tab to display contents of a new file, that’s obvious. But it’s not that obvious that closing unused tabs may be a good move too.

I observed that I really work with 2-3 editors on average. The rest of open tabs is a side effect of code exploration; these are tabs that I open once to e.g. check a definition of method and then I don’t need any longer

So how to quickly close unnecessary tabs in Eclipse?

There are five ways that I regularly use to clean up unused tabs in Eclipse:

  1. Closing tabs one by one by clicking on the tab with a wheel/MMB. It’s faster than clicking LMB on a small cross icon, because it’s enough to click anywhere on a surface of a tab. I do it when there is few tabs to close (like one or two) and tabs that I want to close aren’t hidden.
  2. Closing current tab using Ctrl+W keystroke. I do when tab to be closed happens to be an active tab. And when I just visited some class to check something and I won’t need to revisit it anymore soon.
  3. Using Ctrl+Shift+W keystroke to close all tabs. I do it when I’m starting completely new tasks or at the moment I’m too lazy for 4. or 5. :-) .
  4. Right-clicking on the tab that should stay open and selecting “Close all others” option. It’s handy in cases where only one editor is significant and others are a result of code exploration.
  5. This is my favourite one: Using ctrl+shift+e keystroke to display “Open editors” dialog, selecting editors that should stay open (with ctrl pressed), “invert selection”, “close all selected” and finally hitting esc to close the dialog. It may seem complex but trust me it isn’t. It took me only a few attempts to learn how to use this trick effectively. I often do it when I forgot to close tabs for a while and I have a lot of tabs open and what’s worse, some of tabs aren’t visible on tabs bar (arrow icon needs to be clicked to see the hidden tabs).
Let these tricks become your habit, unconditioned reflex in reaction for too many tabs being open. You’ll see how smooth experience with Eclipse may be!

Productivity aspect

Tabs bar, if used properly, is a great productivity improvement tool that serves as a kind of cache for a developer. If only the relevant tabs are open, then everything important is right there, in a range of one click! No searching throught the project, no need to remember file names, etc. Just like cache memory works best when storing only the most frequently accessed data, our work with Eclipse and other tools is more effective when number of tabs open tabs is limited.
Summing up
Your IDE is like a desk where you study for exams. Can you effectively study with 10 open books lying around on your desk? It would distract me.

As humans, we can’t wrap our heads on too many things at the same time. Let’s use our tools wisely, so that we can only focus on what is really important.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>