Eclipse: keyboard shortcut to move tabs around? - eclipse

Is there any way to setup an Eclipse keyboard shortcut which will split the current editor vertically and put the current tab on one side? For example, turning this:
before http://img.skitch.com/20100118-1n5xeuywunri6b91nfjpgdxxne.png
Into:
after http://img.skitch.com/20100118-t2c7g3nctx3w8bth4hq1rpqp9k.png

Not directly with eclipse (3.4 or 3.5)
The closest plugin I have found which might enable what you are looking for is the Split file Editor
Ctrl+6
Usage: Open a file in Eclipse, then select Window -> New Split Editor from the main menu to open a split editor of the file.
(not exactly what you want but:)
Split editor opens in a new tab as opposed to appearing within the existing tab
(so while there may be 2 instances of the same file editor, you still have a situation with one file on one side, and the other files on the other tab group)

Related

Can Eclipse hold multiple different 'Compare' windows at the same time?

Like in the topic - is there any default way or any plugin that lets you have multiple 'Compare' windows open and active at the same time? I find it very frustrating that while doing changes to few files at the same time, I can't have active 'Compare' window for each of them, to see my changes/original code.
I would use Window -> New Window, rerun Team -> Show History and then compare another file.
A compare window in Eclipse is placed inside a normal editor tab.
You can have several editor tabs, including compare windows, visible at the same time. To do this just drag the editor tab (the one on the top with the editor name) to somewhere inside the editor area. The editor area will get split in two, each one displaying one editor.
This works with more than two editors also.
If you find that you need more space for the compare windows because other views take up much space you can maximize the editor area by pressing Ctrl+M while the editor area has focus.
Example:
Go to preferences -> team -> General Team Preferences. For me, the "Reuse open compare editors when opening comparisons" was already checked by default. I unchecked that and now I can have multiple file comparison windows open! (I'm using Eclipse Oxygen.3a -- 4.7.3a)

Is it possible to duplicate the view of the same source file in Eclipse?

I'm doing some manteinance to a .cpp file with eclipse and I need to compare two methods. It's very uncomfortable to jump ahead and back to check differences.
Is there a way to duplicate the view of the same source file, in order to compare them side by side?
Edit the file and use Window > New Editor to open a second editor on the file. Then drag the title tab of the second editor and Eclipse will show on outline of how it is going to arrange the two editors. You can arrange the two editors vertically or horizontally.
Update:
Eclipse 4.4 Luna (currently only available as Milestone builds) adds support for splitting the editor directly using Ctrl+_ and Ctrl+{.

How do you join back the split editor panes in eclipse

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.

How to enable duplicate tabs in Eclipse? (i.e. duplicate windows)

If there's one thing I miss about emacs it's having 4 windows of the same file open, each at a different location in that file, for super quick referencing. Is there a way to get Eclipse to present multiple tabs of the same file?
On the Window menu choose Editor, then Clone (since 4.4.x) or New Editor (earlier versions). You can then drag the title bar around to get side-by-side views.
Another way would be to split the code editor view twice
But this will only be possible with Eclipse Luna 4.4 M4, as detailed by Lars Vogel in "Split editor implemented in Eclipse M4 Luna", in Bug 8009:
The split editor functionality has been developed in Bug 378298, and will be available as of Eclipse Luna M4. The Note & Newsworthy of Eclipse Luna M4 will contain the announcement.
Current shortcut for splitting is:
Ctrl + _ for split horizontally, and
Ctrl + { for split vertically.
Depending on your keyboard layout:
Andrew adds in the comments that you can need Ctrl + Shift .
el-teedee mentions (also in the comments) that, when pressing CTRL+{ in my Javascript editor, it inserts ''.
To fix this, I need to press CTRL+ALTGR+{ (Linux Ubuntu French keyboard),
Yeah, just right-click on the editor tab you want, and select "New Editor". It'll create a new tab editing the same file. You can then drag this new tab to the left or right edge of the view to get them in a "split screen" state. It's really very flexible.
I figured it out. Right-click tab > New Editor.
Other answers explain how to open multiple editors or split editor. If we are talking about other tabs/views that are not editor, it depends on the implementation.
TLDR: search for pin toggle or create new view button/option in view!
History view, Search view and other pinnable tabs - have "Pin this XXX View" toggle:
If you pin it it will keep the content and new Search (or history show) will show in new history view.
History view also has "Reuse Compare Editor" option so compares can be opened in same or separate tabs:
Markers view has option "New Markers View":
This view can be named and you can set custom filter for each view.
Similar is "Terminal View" that has button to open new terminal view:
Some tabs do not have any option to be duplicated. Tested with Eclipse 2019-12 (4.14.0)
I faced similar problem, but not with the main edit tabs: I wanted to have duplicate tabs in additional view panel (exactly: two junit views to compare different test runs).
In my case the only possible way to achive such thing was creating separate window: Window > New Window and openning new view there.
p.s. I'm using eclipse kepler 4.3.1.
For eclipse kepler , you can try right-click > open-with > any other like text editor
select window menu, then editor option, then clone

Changing number of rows of tabs visible in NetBeans

There are times when I have a decent number of source files open at once. Is there a way to change the number of rows of tabs that are visible while working in NetBeans?
Also, I have a dual monitor setup here. I could span NetBeans across the two monitors if it were possible to have multiple NetBeans editor windows open at the same time. This is something that I use in the VS Express editions. I tend to group my source files on one monitor and the designer windows in the other. Can I do this in NetBeans?
for versions 8.0.2+:
Tools -> Options -> Appearance -> Document Tabs -> Multi-row tabs
You can also maximum row count if you wish (the default is 3).
There are 2 way's I have done this:
Drag a tab from the editor panel to the side of the editor window until the red outline shows a rectangle running from top to bottom. Drop the tab there and you get another editor pane. Opening from Project or Files will still use the original panel, but you can drag tabs between the panels.
Right click on a tab and choose "Undock Window". This will create a top-level window independent of the main NB window.
When you create files with keyboard shortcuts (eg, Ctrl-N for new file) they will open in the current panel. Likewise, navigating to other files (eg, Ctrl-Shift-B for go to source).
It's not perfect though. Some keyboard actions will dump you back to the main window, then it's Alt-Tab or fiddle with the mouse to get back.
You can control the number of rows of Tabs in Netbeans by going to (on Windows):
Tools>Options>Miscellaneous>Windows> check the multi-row tabs checkbox.
See the maximum row count with the radio button and set your number.