Compare related files in two editor groups
Split the editor when you need to compare related files, such as code and its test. Check which group has focus before typing.
On this page
Give each editor group a purpose
VS Code supports multiple editor groups. A split is useful for an implementation and test, a caller and definition, or related configuration files.
Start with the relationship you need to inspect. Putting unrelated material on both sides creates more places to search without answering a question. Decide what belongs in each group and keep the original file identifiable, especially when several open tabs have similar names or come from different folders.
Make and review one small change
- In a disposable project, place a simple function in one group and its test in another. Read the expected behavior before deciding where an edit belongs.
- Move focus deliberately, make the change, then inspect the relevant diff and run an appropriate check. Seeing two files beside each other does not validate their relationship. The useful part of the split is keeping the expectation visible while you inspect the implementation that should meet it.
Return to one group when comparison ends
Extra groups take screen space and can make labels difficult to distinguish on a small display. Simplify the layout when you no longer need the comparison.
Group navigation and key bindings may be customized. If focus moves unexpectedly, inspect your current settings instead of assuming the file you can see is receiving input. The goal is a clear comparison and a checked change, rather than fitting the maximum number of editor panes on screen.
Sources and corrections
Based on the official documentation below. This is not a claim of hands-on testing.
- User interface — Visual Studio Code · checked 2026-11-03
- Default keyboard shortcuts — Visual Studio Code · checked 2026-11-03
Review details and corrections
Codex — primary-documentation and editorial review. Report a correction with the app and macOS version. Leave private document names out.
Related shortcut guides
Related articles
See shortcuts for your active Mac app.
Open the menu-bar reference with a click or your configured keyboard trigger.
Explore KeyboardShortcuts.pro