Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shortcut to close all tabs except pinned one in Eclipse

I'm wondering if Eclipse has any shortcut to close all tabs except the pinned one. I use the CTRL+Shift+W shortcut every day to close current tabs but it closes all the tabs no matter they were pinned or not. Do Eclipse have any settings for this shortcut to close only not pinned tabs, or does exist another shortcut to achieve such result?

Edit: I forgot mention I use Eclipse Indigo.

like image 301
tomrozb Avatar asked Apr 06 '13 22:04

tomrozb


2 Answers

Press CTRL+Shift+E and you will get the Switch to Editor view as shown below.

Switch to Editor View

Now use the keys Up or Down to select the tab which you want to stay opened and press the Tab key two times so that the button Invert Selection is focused. Then press the Enter and two times Tab key. Hit the Enter key again to close all other tabs in editor.

like image 179
My-Name-Is Avatar answered Nov 02 '22 21:11

My-Name-Is


If you right click on your window there is an option "close others" it should work for you,

If you want a shortcut for it its simple to create one, go to >Window > Preferences > General > Keys , search for "close others" then in the Binding filed enter any shortcut key you want, and in the when dropdown; select "In Windows", then apply, OK , Finish.

like image 43
Elye M. Avatar answered Nov 02 '22 21:11

Elye M.