Arne Evertsson
Arne Evertsson

Reputation: 19829

How to create two editor panes for the same file?

I usually have a vertical split with two editor panes next to each other. Is there a way to have the same file in both of these panes?

Upvotes: 98

Views: 58843

Answers (8)

shahid
shahid

Reputation: 71

For newer versions, uncheck this setting.

settings -> Advanced Settings -> Editor Tabs -> When navigation to a file, prefer selecting existing tab in inactive split pane

This will open the file in current split, if if it is open in another split.

Upvotes: 2

Deqing
Deqing

Reputation: 14632

IntelliJ IDEA 2021.2

Right click on the file tab > Split Right / Down

Upvotes: 5

MotohawkSF
MotohawkSF

Reputation: 2603

Alt-Shift-Enter

In the 'Open File' or 'Go To Class' dialog, or Project view, press Alt-Shift-Enter (instead of just Enter) to have the selected file open in the current pane even if it's already open in another pane.

Shift-Enter will open the file in a floating window.

Older versions of IntelliJ

In older versions of IntelliJ (maybe before IntelliJ 2016): this shortcut was just Shift-Enter.

Newer versions of IntelliJ (2019.2)

Shift-Enter

Upvotes: 97

Pawel Rawski
Pawel Rawski

Reputation: 21

Press Shift-Ctrl-Enter if you use IdeaVim and want same file get opened in an active tab group.

Upvotes: 2

ROMANIA_engineer
ROMANIA_engineer

Reputation: 56636

IntelliJ IDEA 15

3 approaches

  1. Right click on the file tab > Split Vertically / Split Horizontally

    Split Vertically

  2. Being in the file that you want to split, press Ctrl + Shift + A > type "Split Vertically" / "Split Horizontally" > Enter

    Action Split Vertically

  3. Being in the file that you want to split, Window > Editor Tabs > Split Vertically / Split Horizontally

    Window Editor Tabs Split

Upvotes: 89

CrazyCoder
CrazyCoder

Reputation: 401975

I'm afraid it's not possible in the recent IDEA versions. Please vote for IDEA-34593 or watch this issue for progress to get a notification when the issue is resolved.

UPDATE: As the issue was fixed, it's possible since IDEA 10, see the reply from MattLeidholm.

Upvotes: -1

Matthew Leidholm
Matthew Leidholm

Reputation: 4469

It's possible in IntelliJ 10. First, use "Window -> Split Vertically" like Mr Rothgiesser suggests; this will open the same file in two panes in your single window. But then, to get it in a separate window, click and drag the tab from the newly-created pane off the original window into its own space on the desktop (that sounds more complicated than it is--just drag the tab off the window).

The file is now open in both windows, synchronized just as Mr Midwood suggests.

Upvotes: 27

b.roth
b.roth

Reputation: 9542

Yes.If you have only one file open and then click "Window > Split Vertically", you get the same file on both sides. At least in IntelliJ IDEA 6.0.

Upvotes: 4

Related Questions