How-to · VS Code for Mac

How to split the editor in VS Code on Mac: shortcuts and steps, 2026

To split the editor in VS Code on Mac, press ⌘\\ while a file is open. VS Code turns that editor into two panes side by side, and both panes show the same file.

Updated Checked against VS Code 1.145 desktop app on macOS3 minEasy

Person typing on a MacBook at a desk, the kind of setup where you split the editor in VS Code on Mac.
Two panes of code are easier to read than one long file. · Image by StartupStockPhotos from Pixabay

Quick answer

  • Press ⌘\ to split the active editor into two panes side by side.
  • Use Open to the Side (⌃Enter) to put a different file beside the one you have open.
  • Click the Split Editor button in the upper right corner of an editor. Hold ⌥ while you hover to get the other orientation.
  • Drag a tab to any edge of the editor area. Hold ⌥ while you drag to copy the tab instead of moving it.
  • Move between split editors with ⌥⌘→ and ⌥⌘←. Checked against VS Code 1.145, released November 4, 2026.

What you need

  • VS Code installed on your Mac, version 1.145 or later
  • At least one file open in the editor
  • A second file in the project if you want to compare two files

How to Split the editor in VS Code on Mac in VS Code on a Mac

  1. Open the file you want to split

    ⌘P

    Open a file from the Explorer sidebar, or press ⌘P and type the file name. Press Return to open it in the active editor.

  2. Split the active editor with the keyboard

    ⌘\

    Press ⌘\. VS Code splits the editor you are working in into two editors side by side. Both show the same file.

    Tip: If ⌘\ does nothing, see the troubleshooting section below.

  3. Or click the Split Editor button

    Move your pointer to the upper right corner of an editor and click the Split Editor button. The result matches the ⌘\ split.

    Tip: Hold Option while you hover over the button to get the other orientation.

  4. Open a second file to the side from Explorer

    Right-click file in ExplorerOpen to the Side

    In the Explorer sidebar, right-click the file and choose Open to the Side. The file opens in a new editor on the right.

  5. Use Quick Open to open a file to the side

    ⌃Enter

    Press ⌘P, type the file name, then press ⌃Enter instead of Return. The file opens beside the current editor.

  6. Drag a tab to an edge

    Hold⌥ and drag

    Drag a tab to the left, right, top or bottom edge of the editor area. Let go, and VS Code splits along that edge.

    Tip: Holding ⌥ copies the tab. Without it, the tab moves.

  7. Choose a preset layout

    ViewEditor Layout

    Open View > Editor Layout and pick a layout from the submenu. The official docs show the options in a screenshot, so check the list on your version.

  8. Move focus between split editors

    ⌥⌘→

    Press ⌥⌘→ to move to the editor on the right, or ⌥⌘← to reach the one on the left. Press ⌘1, ⌘2 or ⌘3 to jump to a group.

  9. Close the editor you do not need

    ⌘W

    Click the tab of the editor you want to remove so it is active. Press ⌘W. Check the file name in the tab before you press it.

Start with the keys, because the Mac keyboard names them differently. ⌘ is Command, ⌥ is Option, ⌃ is Control and ⇧ is Shift. VS Code on Windows uses Ctrl for many of the same actions. Open to the Side, for example, is Ctrl+Enter on Windows and ⌃Enter on a Mac, so the Control key is the one to watch. This guide was checked against VS Code 1.145, the latest stable release, which came out on November 4, 2026. The official User Interface page is dated November 4, 2026, and it does not name a version number. Treat its steps as current for this release.

Three ways to split the editor in VS Code on Mac

The fastest route is the keyboard. Press ⌘\ and VS Code splits the active editor in two. Both halves show the same file, so you can read the top of a long function on the left and edit the bottom on the right. The Split Editor button does the same job with a click. It sits in the upper right corner of an editor. The third route is Open to the Side. It puts a different file in the new half, which is what you want when you compare two files. Pick the route by asking one question: do you want the same file twice, or a second file?

Split with the Split Editor button on your Mac

Find the Split Editor button in the upper right corner of an editor. Click it once. A second editor opens beside the first, showing the same file. Hold Option while you hover over the button, and VS Code offers a split in the other orientation. Use that when you want the panes stacked instead of side by side. The button only appears when an editor is open. With no file open, there is nothing to split, so open a file first.

Person typing on a MacBook at a desk, the kind of setup where you split the editor in VS Code on Mac.
Two panes of code are easier to read than one long file. · Image by StartupStockPhotos from Pixabay

Open a second file beside the first with Open to the Side

Say you are changing parser.py and want its test file open next to it. You have two good options. In the Explorer sidebar, right-click test_parser.py and choose Open to the Side. Or press ⌘P, type test_parser.py, and press ⌃Enter instead of Return. Either way, the test file opens in a new editor on the right, and parser.py stays where it was. Use this method when you need two different files. It does not copy the file you are already reading.

Four ways get a file beside another one in VS Code on Mac:

  • Right-click a file in the Explorer sidebar and choose Open to the Side.
  • Press ⌘P, type the file name, and press ⌃Enter.
  • Hold ⌥ and select a file in Explorer. The docs call this Alt-select.
  • Drag a file from Explorer to any side of the editor area.

Drag tabs to any edge to build your own layout

Drag a tab to the left, right, top or bottom edge of the editor area, and VS Code splits along that edge. Let go, and the tab lands in its own editor. This is the most flexible method because you choose the edge with your pointer. Dragging a tab moves it by default, so the file leaves its old spot. Hold ⌥ while you drag, and VS Code copies the tab instead. That gives you the same file in two places. It is useful when one pane shows a function and the other pane shows the code that calls it.

Preset layouts and the in-group split in VS Code on Mac

If you want a fixed grid, open View > Editor Layout. The submenu holds predefined layouts. The official docs show those options only in a screenshot, so read the list on your own screen. Pick a layout, then open files into the panes it creates. Each pane is an editor group, and each group keeps its own set of tabs.

The shortcut ⌘K ⇧⌘\ runs View: Split Editor in Group. It looks like the ⌘\ split, but the result differs. A normal split creates a new editor group. The in-group split adds a second view inside the group you already have. Use it when you want two looks at one file without a second set of tabs. If the layout looks unexpected, check which of the two shortcuts you pressed.

Move between split editors with the keyboard

Once two editors are open, focus decides where your typing goes. ⌥⌘→ moves focus to the editor on the right, and ⌥⌘← moves it to the one on the left. ⌘1, ⌘2 and ⌘3 jump to the leftmost, center and rightmost group. With only two groups, ⌘3 has no group to reach. Check the active pane before you type or press ⌘W. Typing always goes to the pane that has focus.

Developer working at a desk with code on screen, showing how to split the editor in VS Code on Mac for side by side work.
Keyboard shortcuts keep your hands on the keys while you switch panes. · Image by StockSnap from Pixabay

Close a split and return to one editor

To go back to one editor, close the one you do not need. Click its tab so it becomes the active editor, then press ⌘W. Read the tab name before you press it. Closing the wrong pane is easy when two files look alike, such as a component and its test file open at once.

Mistakes people make when they split the editor

  • Pressing ⌘K ⇧⌘\ and expecting a new pane. That command stays inside the current group.
  • Dragging a tab without holding ⌥. The file moves out of its old pane, so it can look like it vanished.
  • Looking for the split button on vscode.dev. The web docs do not confirm split support there.
  • Assuming ⌘\ always works. Another app, macOS or a custom keybinding can claim the same keys.
  • Splitting before you open the files. Open the files first, so both panes show something useful.

When ⌘\ does nothing on your Mac

Start in the Keyboard Shortcuts editor. Press ⌘K ⌘S, then search for split editor. If the entry shows a different key, someone changed the binding. Right-click the entry and choose Show Same Keybindings to see what else uses the combination. VS Code checks keybinding rules from the bottom up, and the first rule that matches both the key and its when clause wins. A custom rule placed lower in your keybindings file can therefore override a default. System-wide shortcuts may also fail to register if macOS or another app uses the same keys. Check System Settings > Keyboard > Keyboard Shortcuts if the VS Code list looks clean.

Splitting the editor on vscode.dev in a browser

The browser version at vscode.dev runs entirely in the browser, so it has limits compared with the desktop app. Some shortcuts behave differently. ⌘N opens a new browser window instead of a new file, and ⌘W does not close an editor, because the browser claims that key. The docs give ⌥⌘N as a workaround for a new file. The web docs do not confirm split support, so use the desktop app for the steps on this page.

A worked example: a file and its test, side by side

Here is a session that uses two methods from this guide. You are fixing a bug in cart.ts. Open cart.ts from the Explorer. Press ⌘P, type cart.test.ts, and press ⌃Enter, so the test opens beside it. Next, hold ⌥ and drag the cart.ts tab to the bottom edge of the editor area. VS Code copies the tab and places the copy below. Now the test file sits on one side, and two views of cart.ts sit on the other. You can edit one copy while you read the other. The exact arrangement depends on where you drop the tab, so try a few edges before you settle on one.

Programmer at a desk with two screens, a setup where split editor panes help when you compare two files.
Split panes work well when you check a file against its test. · Image by andreas160578 from Pixabay

Where to go next with split editors

Once the layout works, you may want colors that make each pane easier to tell apart. The guide on changing the color theme in VS Code on Mac walks through the menu path and shortcut. If you write a lot of Python, the data scientist setup for VS Code on Mac covers notebooks and shortcuts. When you practice, add your own key for the split command you use most. Right-click an entry in the Keyboard Shortcuts editor and choose Configure Keybinding.

VS Code shortcuts for this on Mac

VS Code keyboard shortcuts on Mac
To do thisPress
Split the active editor⌘\
Split inside the same group (View: Split Editor in Group)⌘K⇧⌘\
Open to the Side from Quick Open⌃Enter
Quick Open to find a file⌘P
Move to the editor on the right⌥⌘→
Move to the editor on the left⌥⌘←
Focus the first, second or third group⌘1,⌘2,⌘3
Copy a tab while dragging itHold⌥ and drag
Open the Keyboard Shortcuts editor⌘K⌘S
Close the active editor⌘W

If it does not work

⌘\ does nothing when I press it
Open the Keyboard Shortcuts editor with ⌘K ⌘S and search for split editor. Right-click the entry and choose Show Same Keybindings. If nothing in VS Code conflicts, check System Settings > Keyboard > Keyboard Shortcuts for a macOS conflict.
I got a new group instead of a split inside the group
You pressed ⌘\, which creates a new editor group. For a second view inside the current group, use ⌘K ⇧⌘\ instead.
Dragging a tab moved my file out of its pane
Dragging moves the tab by default. Drag it back to its old pane. Next time, hold ⌥ before you start the drag to copy it.
There is no Split Editor button
The button only appears on an open editor. Open a file first, then look for the button in the upper right corner of the editor.
The split steps fail on vscode.dev
The web docs do not confirm split support in the browser. Use the VS Code desktop app for these steps.

Faster with Lazur

Do it faster: ask Lazur while you are in VS Code

Hold ⌥ ⌘ and say what you want. Lazur sees your VS Code window. Lazur draws a circle and a label around the button or menu you need.

  • 1

    Hold ⌥⌘ and talk

  • 2

    Lazur draws a circle and a label around the button or menu you need.

  • 3

    You stay in VS Code. Nothing to copy into a chat window.

Free for 3 days, then $18/month. Download for Mac

You say“Where is the Split Editor button?”

Lazur · points at itLazur draws a circle and a label around the Split Editor button in the upper right corner of your editor, and says where it is.

VS Code
ExplorerSearchSplit Editor buttonRight hereSource ControlRun

Questions people ask

What is the shortcut to split the editor in VS Code on Mac?

Press ⌘\ while an editor is active. VS Code splits that editor into two panes side by side, and both panes show the same file. ⌘K ⇧⌘\ is a different command that splits inside the current group.

How do I split VS Code vertically or horizontally on a Mac?

Hover over the Split Editor button in the upper right corner of an editor, and hold ⌥ while you hover. VS Code then offers a split in the other orientation. You can also drag a tab to the top or bottom edge of the editor area.

How do I open two files side by side in VS Code on Mac?

Use Open to the Side. Right-click the file in the Explorer sidebar and choose Open to the Side. Or press ⌘P, type the file name, and press ⌃Enter.

Why did my file move when I dragged it?

Dragging moves a tab by default. Hold ⌥ before you start the drag to copy it instead. If the file already moved, drag the tab back to its old pane.

Can I split the editor in VS Code for the web at vscode.dev?

The web docs do not confirm split support. The browser also claims ⌘N and ⌘W, so some shortcuts behave differently there. Use the desktop app for these steps.

How do I unsplit the editor in VS Code on Mac?

Click the tab of the editor you want to remove so it is active, then press ⌘W. Check the tab name first. Closing the wrong pane is easy when two files look alike.

Do these steps work in VS Code 1.145?

The 1.145 release notes, published November 4, 2026, list no changes to editor layout, split editor, editor groups, or split shortcuts. The steps on this page apply to that version.

Sources

  1. VS Code User Interface docs · Microsoft · checked 2026-11-09
  2. VS Code Default Keybindings reference · Microsoft · checked 2026-11-09
  3. VS Code Keybindings docs · Microsoft · checked 2026-11-09
  4. Visual Studio Code for the Web docs · Microsoft · checked 2026-11-09
  5. VS Code 1.145 release notes · Microsoft · checked 2026-11-09

Try Lazur free for 3 days

Hold a key and ask. Lazur sees your screen, points at the button and talks you through it, in any Mac app. No credit card.