Eclipse auto close unused tabs - eclipse

I have this habit of looking into other source codes from different projects for a reference. However, this leads to cumulative issue of forgetting to close the tab. I may have around 100 source tabs opened up (which is related to current and unrelated projects).
Is there a preference or plugin to auto close unused tabs after certain idle period? Like say after 10 minutes of inactivity.
The issue I face is when I'm in a hurry the tabs pile up and consume lots of memory, and not to mention if you have opened up Chrome for reading documentation and StackOverflow digging. Finally slows down my system due to swap usage.
[ Update ]
Found some interesting tips from this link
So how to quickly close unnecessary tabs in Eclipse?
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 closearen’t hidden.
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.
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. :-) .
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.
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).

There is a feature General > Editors > Close editors automatically which closes unused editors automatically.

There is no auto-close feature/plug-in in eclipse. Because user opened all the editors manually and he/she has to close these on their wishes but not automatically.
For your problem I suggest you to use Mylyn plug-in so that you can stick to only those editors(context) you frequent used, hiding all other editors, packages, classes etc.
Also there is an eclipse plug-in for pinning editors refer my answer for the post Eclipse - How to pin editor tabs?

Related

Tidy Tabs, but for VSCode?

I really miss the "tidy tabs" extension that automatically closes tabs older than a certain age in Visual Studio. Is there any extension for VSCode with similar functionality?
As of version 1.42, we can now set a maximum number of tabs to leave open in each window, which effectively replicates tidy tabs.
Limit the number of open editors
There are new settings to limit the maximum number of editors that are
open at the one time.
workbench.editor.limit.enabled: Enable this feature (off by default).
workbench.editor.limit.perEditorGroup: Whether to apply the limit per editor group or across all groups.
workbench.editor.limit.value: The maximum number of open editors (10 by default).
If enabled, VS Code will close the least recently used editor when you
open a new editor.
There is zentabs (inspired by zentabs for Sublime Text). It works but with some caveats:
It only closes an old tab when a new one is opened, so it won't help to clean up an existing tab-heavy session, but it should help to prevent it from growing any larger.
Due to VSCode extension limitations, it will briefly switch to any tab it decides to close. You may see this as a temporary flicker when you open a new tab.
As a result, it will sometimes bump the old closed window up to the top of the most-recently-used list on Cmd-P / Ctrl-P, which can be unintuitive.
It also asks you to disable the preview feature (opening unpinned tabs when stepping through searches). That is a shame because that VSCode feature let us do a lot of searching without cluttering our tabs too much.
Under some circumstances (when using search?) I end up with more tabs open that my prescribed limit.
If a file is unsaved when its tab is closed, VSCode will show a popup asking if you want to save the file.

How to navigate through a lot of files in Eclipse without opening them

In some popular code editors and IDEs such as Sublime Text and Xcode, we can swiftly navigate through lots of code files by a single click without opening them. This is an advantage when we look into many parts of the code base scattered across the projects but nevertheless want to avoid opening too many tabs, which affects performance on slow machines. Does anyone know such a "navigating-without-opening" functionality in Eclipse?
I understand that Eclipse does provide a lot of useful shortcut keys to switch between opened tabs and classes in the project, but what I am looking for is the functionality whereby I can switch between files without opening them in a new tab by a single click (and preferably open specific files by double clicks when we want to keep them opened in new tabs).
EDIT:
I am not searching specific classes or methods. Rather, I would like to peek project files one by one to grasp the structures of the application which contains hundreds of files. In Sublime Text and Xcode, unlike in Eclipse, when one clicks file names in the project explorer only once, the files get opened in a "temporary tab" which automatically closes when we single-click another file. For example, in the following screenshots, when I single-click ToDoListPane.java in Sublime Text or CNBackgroundView.h in Xcode, the files are opened in new temporary tabs, but once another file such as HelloWorldSpring.java or CNAppDelegate.m is clicked once, then the contents in the temporary tabs are switched to those of HelloWorldSpring.java or CNAppDelegate.m without additional tabs being created.
Use Ctrl+Shift+R to search files by name (pattern).
If you know a string that is inside of the files you seek, you can use Search -> File Search (there is a button in the toolbar for that).
Related:
http://www.vogella.com/tutorials/EclipseShortcuts/article.html
http://eclipse.dzone.com/news/effective-eclipse-shortcut-key
http://www.shortcutworld.com/en/win/Eclipse.html
[EDIT] For exploring unknown code, try the "Java Browsing Perspective", it's optimized for this use case.
As for "slow performance", I have often more than 99+ files open without a big impact on performance.
As a quick way to close tabs, you have several options:
Click anywhere in the tab with the middle mouse button to close it.
Use Ctrl+W to close the current tab
Use the tab's context menu to close it, close all tabs or close all other tabs.

Eclipse - Close tabs to the right

Is there a plugin or some way to get a behaviour of close tabs to the right, like the chrome browser?
Close others allows you to keep only one single file open afterwards.
Close tabs to the right is essential, as it allows you to place files that are important on the left side, and then whenever you open tabs, you can still keep those that are important when closing the others, the right ones.
I don't think there's a plugin for that.
As an alternative, you could do CTRL+SHIFT+E to bring up the "Switch to Editor" dialog. From there, you could select all the editors to the "right" of your active tab and click Close Selected Editors to close them. It's not as fast as what you wanted but it lets you organize your tabs the way you want to (i.e. important tabs to the left).

How to disable Eclipse's behavior of maximizing editor when double clicking a tab?

I recently updated my Eclipse (now running 20100218-1602), and I've found whenever I click around quickly between tabs on the tab bar, it will sometimes maximize the editor and hide the PHP Explorer to the left. After researching a little, this appears to be a feature of double clicking a tab. So I guess it's my fault, I'm sure I'm clicking around too fast and mistakenly double clicking a tab, but it happens often enough on what I'd consider a normal editing session that I've come to absolutely loathe it, and even after the usual googling due diligence cannot figure out how to turn it off.
From this post someone mentions the Window.AutoHideAll shortcut, however that seems to only be for assigning keyboard shortcuts--this is a mouse click thing. But maybe it's a clue.
I can't find anything relevant under Eclipse -> Preferences -> PHP. I don't think it's specific to PHP because if I switch to the Java perspective, double clicking a tab hides the Package Explorer.
Any suggestions are appreciated, thanks!
You could settle for a simpler solution than some arcane settings or shortcut:
resize your Eclipse main windows a bit smaller
drag the views you do not want to be covered after a "tab double-click" outside the main Eclipse window
there is no 3.
When you double-click, the Editor will cover only the main Eclipse window, while the other views will still be visible just beside that window.

Is it possible to dock the "Find/Replace" window in Eclipse?

I could have sworn I saw it once before in a screencast where someone had the find/replace window docked in their Eclipse environment.
However looking through the list of options in "Window > Show" the closest thing I can find is the Search window.
I find that I use it quite a bit and with larger monitors these days I figure I could afford to have it open in my perspective all the time.
Is this possible?
Thanks.
One poor-man's workaround is to dock a view that you don't need in a part of Eclipse where you want the find/replace view and then place the find/replace dialog on top of that like this:
Clearly this is a huge kludge but it does work.
I am not sure about that, since Fast views are:
icons allowing users to quickly display different views that have been created as fast views
And the search/replace is a Dialog, not a View..
(source: bpsite.net)
(That Dialog box is not like Views, which support editors, also have their own menus. Some views also have their own toolbars.)
The help page mentions:
Fast views are hidden views that can be quickly opened and closed. They work like other views except they do not take up space in your Workbench window.
This might not be an exact answer for the question. But this works like a charm.
Press ctrl + j and keep typing...
Use ctrl + k to go on
Use shift key wherever required.
Use Edit > Incremental Find Next (Ctrl+J) or Edit > Incremental Find Previous (Ctrl+Shift+J) to enter the incremental find mode, and start typing the string to match. Matches are found incrementally as you type. The search string is shown in the status line. Press Ctrl+J or Ctrl+Shift+J to go to the next or previous match. Press Enter or Esc to exit incremental find mode.