72

Say I'm reading file xyz.py. And I want to see both func_x and class_y at the same time, so that I don't have to keep on scrolling up and down to go back and forth.

How would I open file xyz.py side-by-side so that I can read both at the same time?

Note: This is different from the question Visual Studio Code: How to split the editor vertically, as it doesn't explain how to have the same window side by side.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
joseph
  • 871
  • 1
  • 6
  • 18

3 Answers3

122

In the top right of your screen there should be a split editor button that looks like this: split editor button

That should do the trick.

The default keyboard shortcut (on windows) is Ctrl+\

Aonghas M
  • 1,863
  • 2
  • 10
  • 20
18

In Command Palette

(Ctrl or ⌘+Shift+P)

Type split e Enter

(Select View: Split Editor)

In sidebar

Alt+Left-click the file

In editor

Click the Split Editor button (Split Editor) in the upper right corner.

Community
  • 1
  • 1
Lars Gyrup Brink Nielsen
  • 3,939
  • 2
  • 34
  • 35
1

None of the above worked for me

but ⌘ + \ worked.

m0r
  • 102
  • 9