How do I open the same file side by side in a single Visual Studio Code session

Visual Studio-Code

Visual Studio-Code Problem Overview


Say I'm reading file xyz.py, and as function func_x, which is on line x, calls class_y, which is on line y, 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 read func_x and class_y. How would I open file xyz.py side by side so that I can read both func_x and class_y at the same time?

Edit: This isn't this, as it doesn't explain how to have the same window side by side.

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

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+</kbd>

Solution 2 - Visual Studio-Code

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionjosephView Question on Stackoverflow
Solution 1 - Visual Studio-CodeAonghas MView Answer on Stackoverflow
Solution 2 - Visual Studio-CodeLars Gyrup Brink NielsenView Answer on Stackoverflow