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
Related
Sometimes when closing vscode, or a tab therein, I get a dialogue asking "Do you want to save the changes you made to filename?" However, the unsaved edits are actually from a previous session that was closed without such a query, probably when turning off the computer, so I can't remember if it was meaningful edits, or maybe just an accidental key-press, like a shortcut gone wrong; and doing undo to revisit the last edits doesn't work either.
My question: How can I see the diff between the saved version of a file, and the version in the editor window? I think it would be nicest just to have a "show diff" option in the dialogue, but for now I'm also happy with a command line diff command.
I'm using ubuntu 20.04.
I'm using VSCode version 1.52.1 on MacOS and I had a similar problem that may not be the same problem, but I'm guessing it will work for you as well.
When you're in the Explorer view, in the upper left part of Explorer you have your "Open Editors." If that shows a dot to the left indicating that the buffer has changes in it, you can right click the file name and select "Compare with Saved." This will open another buffer to the side that will show you any unsaved changes.
To get rid of that window (it took me a bit to figure this out I'm sorry to say!), you can click the 'X' to the left of the extra buffer in "Open Editors."
Hope this works for you!
A few bright notes for the keyboard players out there:
The command you are asking about has a default shortcut. Unless you've applied a keyboard map extension, the Ctrl+Kd arpeggio opens the very same diff view between the active and saved versions of the current file. The default shortcut to close an editor tab (be it the diff or a file or anything at all) is Ctrl+W.
The command, like any command in VSCode, is also accessible via the Ctrl+Shift+P command dropdown (on Linux, F1 opens it too). Start typing e.g. compa sav (it saves your keyboard wear and tear to shorten words to a prefix which is unambiguous enough), and the list will shrink dynamically to just a few commands. Yours is File: Compare Active File with Saved. When it's close to the top enough, navigate the list of commands with the down arrow and execute it with Enter. As a bonus, you may click on the little gear to the right of the command currently highlighted in the list and redefine its shortcut, if you use it very often and prefer a chord shortcut to the default arpeggio one. Sorry, there does not seem to be a shortcut in lieu of the gear click. If there is, please let me know!
But if you really, really want to right-click on the filename in the Open Editors view of the Explorer sidebar, you can open that view directly with, you guessed it, a shortcut: Ctrl+Ke. And if you change your mind on a dime right at this moment, or realize that you in fact never had a mouse to do the right-click in the first place, use Shift+F10 to drop down the "right-click menu", properly called the context menu, which you navigate with arrows and execute with Enter (that's kinda a common theme, as you probably noticed). This works mostly anywhere the right-click does.
While in the Open Editors view, to switch to an editor file tab, move the selection to the desired file. Press Space to bring the file into view but stay in the Open Editors view, or Enter to bring the file into view and shift the keyboard focus to it. Pressing Ctrl+Shift+E brings focus back to the editor from any view in the Explorer sidebar. The same shortcut moves focus to the Explorer sidebar from the editor.
Happy ♬ k'boarding ♬!
ctrl+shift+P (or command+shift+P on mac) and fuzzy search for "compare changes with saved files"
I keep accidently hitting ctrl-t in Doctor Racket, and then when it opens a new tab, the only way I know how to get rid of the unwanted new tab is by closing everything and reopening the files I want to edit.
Is there a better way?
While the tab you want to close is active, you can either select "File -> Close" in the menu or use the keyboard shortcut Ctrl+W to close it.
Yes. In the file menu you have the option called "Close" It will only close the active window so if there are more tabs only the active one will be closed.
You can do the shortcut instead, which is CTRL+w for a Windows or Linux system while its CMD+w on MacOS. If you see in the menu there are hints on these shortcuts.
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.
I use dual monitor for work and I prefer to have the editor on my main screen while the rest of eclipse in my laptop monitor.
However, when I open a new file, that is. I open a file with Cmd-Shift-R, files are opened in my laptop monitor as opposed to the editor that I dragged to my main screen.
I find this mildly annoying. Any ideas?
Are using the Window -> New Window feature? In that case it depends on which window you're working on at the time you press Ctrl+Shift+R.
However, if you're streching only one Eclipse window along both monitors, then the Open Resource dialog will be opened in your "monitor number 1" (and that depends on your graphic configuration: Laptop+Main or Main+Laptop).
I found easier to avoid the new window menu and just to drag those views out of eclipse. This creates a secondary window but the project explorer is linked to the old window so double click will open the file on the main window.
I recommend to save everything as a new perspective that I usually call "Java 2 Windows". This way I can change perspectives when I do not have an auxiliar screen.
P.S. Just avoid closing the auxiliar window when leaving eclipse.
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).