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).
Related
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.
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?
On Eclipse, with Window -> New Editor or by drag/drop method* I could have one more editor panes in my eclipse work area. Now how do I remove that extra pane when I do not need it anymore. All it allows me now is to minimize/maximize that editor extra pane. It just sticks around. Shouldn't there be a collapse or close extra editor panes (that is without me requiring to do Window->Reset Perspective!)
Ref: answers to another question: How do you split and unsplit a window/view in Eclipse IDE?
Right-click on a tab in the window you want to close and select "close all". This will close the split window (and close any tabs in that window that have not been dragged to another window).
HandySplit has a flatten action that you need and other capabilities that you might find useful.
Once you have a bunch (20+) source windows open in Eclipse is there way to close them with clicking all the close buttons on the tabs? It takes a long time and if you double click the middle button it maximises the window instead.
I guess worst case I'll learn to write a plugin that just closes them all, but ideally I want a little list box that I can easily close them in, like the buffer list in emacs or the window list in devstudio.
Right click one of the source tabs, then click "Close all". This is in Eclipse 3.4, don't know what version it was first available in.
Beside the "Close All" functionality kbrasee mentioned you can work with a "buffer list" using Window / Navigation / Switch to Editor (or Ctrl+Shift+E). In this dialog you can select multiple editors for saving / closing.
Maybe this is a little bit unrelated to your question but you can limit the number of open files by selecting "Window > Preferences > General > Editors > Number of opened editors before closing". If you set it to 8, opening the 9th file will close the file you visited most early.
For a fast and selective solution you can click with the mouse wheel (yes!) into the middle of a tab you want to close. You don't have to target the close X.
To close all your open files in Eclipse, simply goto File -> Close all
First if you use the right click mouse on the tabs you can choose either Close All or Close Others.
Second you can press Ctrl+Shift+W to close all the opened tabs.
An addition to what mentioned by others,
If the undesired tabs are related to a project, you can right click the project name and choose close project, all its taps will be closed
I'm trying to make the switch from Emacs to Eclipse. One thing that seems to be missing is its buffer/window support.
I know in Eclipse I can drag an editor's tab title over to split the view, creating the equivalent of a new Emacs window, which is a step in the right direction.
I can't find any key bindings for this functionality, though. Ideally, I'd like to be able to set keys to split horizontal, split vertical, switch to next (there is a next editor, but I want the next window/whatever you call it), switch to previous, close this window split (not this editor), close all other editor window splits.
As it is, the only way I've found to close a split pane is to drag all the files over one by one until none are left. Things like this make working with split screens tedious in Eclipse.
Any help would be appreciated, hopefully there's something simple I'm missing.
Emacs+ has this exact behavior for Eclipse: http://www.mulgasoft.com/emacsplus
According to the keys preference there is an unbound command to open a new editor, which would open another tab rather than split the view. There is also an unbound command to close all other editors. Ctrl+W will close the current editor and Ctrl+F6 will switch between tabs. You can bind or rebind these to be closer to their Emacs equivalents. Alternatively there is an Emacs key map which you may find more helpful. Unfortunately I don't it's possible to split the view from the keyboard.
Try Ctrl-Tab and Ctrl-Shift-Tab for cycling through tabs (buffers) and Ctrl-F4 for closing a tab. You can also look through the shortcut bindings in the eclipse configuration.