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

2019-03-09 08:25发布

问题:

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?

回答1:

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.



回答2:

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),



回答3:

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.



回答4:

I figured it out. Right-click tab > New Editor.



回答5:

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.



回答6:

For eclipse kepler , you can try right-click > open-with > any other like text editor