How to open a new window in VS Code

Jugo Mobile
By
Jugo Mobile
Jugo Mobile is a platform dedicated to high-quality content in gaming, sports, and tech. Engage with high-quality content and connect with fellow enthusiasts and experts. Explore...
9 Min Read

Visual Studio (VS) Code has some of the most convenient tools for editing cross-platform source code. In your data navigation, you may want to move some of the information to another screen. The best way to achieve this is to open the data in a new window, but how exactly is this done?

You’ll find out right here. Continue reading for our step-by-step guide to opening a new window in VS Code.

How to open a new window in VS Code

VS Code can get complex at times, but the basic features are not rocket science. Opening a new window is no exception. You just need to tap a few buttons to open a new window in your workspace if you are a Windows or Linux user.

  1. Open your VS Code workspace.
    How to open a new window in VS Code
  2. Press the keyboard shortcut “Ctrl + K” and release the buttons.
    1711027831 524 How to open a new window in VS Code
  3. Press the “O” button to open your tab in a new window.
    1711027831 848 How to open a new window in VS Code

There is another key combination with the same effect.

  1. Go to the file you need a new window.
    1711027831 551 How to open a new window in VS Code
  2. Hold down “Ctrl + Shift + N” until a new window appears.
    1711027831 375 How to open a new window in VS Code
  3. Drag the file to your new window.
    1711027831 717 How to open a new window in VS Code

The process is just as simple for macOS professionals.

  1. Launch VS Code and navigate to the workspace where you want to add the new window.
    How to open a new window in VS Code
  2. Press the key combination “CMD + K”.
    1711027831 480 How to open a new window in VS Code
  3. Release the buttons and tap “O” to open a new window.
    1711027831 848 How to open a new window in VS Code

If none of the shortcuts work, you may have accidentally changed the shortcut. Alternatively, someone else may have used VS Code from your device and set up a shortcut of their preference. Either way, you should check your shortcut to avoid the need to try random combinations. Here’s how to do it.

  1. Press the shortcut “Ctrl + Shift + P” to open the list of key combinations. If you’re using macOS, press “CMD + Shift + P.” An even faster way to open the command overview is to tap F1. It should work on all devices, regardless of their operating system.
    1711027831 66 How to open a new window in VS Code
  2. Enter “new window” in the search field. You should now see a shortcut that corresponds to the following function: open the active file in a new window.
    1711027831 378 How to open a new window in VS Code

How to switch to different window groups

As mentioned above, opening a new window splits your screen into two groups. It is a great move if you want to improve your productivity and work on multiple files simultaneously.

But to improve your workflow and make the most of the new window feature, you need to know how to switch between different groups of windows. Shortcuts will also be your best friends here.

Here’s what you should do if you use VS Code on Windows.

  • Return to the previous group of windows by pressing the key combination “Ctrl + K”, followed by “Ctrl + left arrow key”. Only after pressing and releasing “Ctrl + K” should you move on to the other shortcut. Holding four buttons at the same time will do nothing.
  • Go to the next group of windows by tapping “Ctrl + K” and “Ctrl + right arrow key.” Again, don’t press the shortcuts simultaneously.

The process is similar if you are a macOS user:

  • The combinations “CMD + K” and “CMD + left arrow key” allow you to move to the previous group of windows.
  • The shortcuts “CMD + K” and “CMD + right arrow key” open the following group of windows. The principle is the same, so activate the combinations one after another.

You can configure different buttons for this function by modifying their shortcuts.

  1. Press “Ctrl + Shift + P” or “CMD + Shift + P”.
    1711027831 66 How to open a new window in VS Code
  2. Enter “View: Open previous editor” to see the shortcut to revisit a previous group of windows.
    1711027831 789 How to open a new window in VS Code
  3. Type “View: Open next editor” to see the shortcut to go to the next group of windows.
    1711027832 109 How to open a new window in VS Code
  4. Use the pencil symbol to enter a new key combination.
    1711027832 390 How to open a new window in VS Code

How to open files in a new tab by default

Speaking of default settings, one of these settings allows a single left click on your file to display the information in preview mode. But what if you want to change this and always get a new tab on left click? Doing so can allow you to organize your data in another way, not just with new windows.

You can do just that with a few simple adjustments.

  1. Tap the “Ctrl + Shift + P” key combination if you have a Windows PC or the “CMD + Shift + P” shortcut if you are a macOS user.
    1711027831 66 How to open a new window in VS Code
  2. Type “user settings” in the search field.
    1711027832 747 How to open a new window in VS Code
  3. Choose “Preferences” and press the prompt that allows you to open your user settings. You can also access your settings by tapping “Ctrl +” or “CMD +”, depending on your platform.
    1711027832 896 How to open a new window in VS Code
  4. Enter the following line: workbench enable preview.
    1711027832 691 How to open a new window in VS Code
  5. Uncheck the box next to the “Editor – Enable Preview” option.
    1711027832 68 How to open a new window in VS Code

The great thing about VS Code is that you can go back and revert changes whenever you want. As a result, you only need to follow the same steps if you no longer want to display files in a new tab. Just check the “Enable Preview” feature and you are good to go.

If you’re up for a challenge, you can also enable new tab settings using their JSON architecture.

  1. Press the key combination “Ctrl + Shift + P” or “CMD + Shift + P”, depending on whether you are a Windows or macOS user.
    1711027831 66 How to open a new window in VS Code
  2. Enter this line in your search box: “user configuration json”.
    1711027832 914 How to open a new window in VS Code
  3. Go to “Preferences” and press the message that directs you to “User Settings (JSON)”.
    1711027832 424 How to open a new window in VS Code
  4. Type this command in the JSON window: “workbench.editor.enablePreview”:false”.
    1711027832 719 How to open a new window in VS Code

By setting the value to “false”, you tell the system to stop previewing your files with left clicks. Instead, each left click now opens files in a new tab.

How to switch to different tabs

Tabs are just as important as windows when it comes to organizing and exploring your information in VS Code. The most common way to do this is to switch to the previous or next tab.

  • Press “Ctrl + Page Down or Page Up” in Windows or Linux if you want to visit the next (Down) or previous (Up) tab.
  • Press “CMD + Option + Right or Left Arrow Key” in iOS to go to the next (right arrow key) or previous (left arrow key) arrow key.

You may also want to switch to the most recent and least used tabs. The following shortcuts will be the ace up your sleeve.

  • Enter “Ctrl + Tab” on Windows and Linux to open the most recently used tab.
  • Enter “Ctrl + Shift + Tab” on Windows and Linux to open the least used tab in your cluster.
  • Enter “CMD + Tab” in iOS to open the most recently used tab.
  • Enter “CMD + Shift + Tab” in iOS to open the least used tab in the cluster.

VS Code window functionality demystified

Opening and working with new windows in VS Code used to be a mystery, but that’s no longer the case. Many ready-made shortcuts let you open and switch between windows to help you work faster. Combined with tab functionality, they can take your workflows to new heights.

How many windows do you work on most frequently? What shortcut do you use to open a new window? Tell us in the comments p below.

Share This Article
Follow:
Jugo Mobile is a platform dedicated to high-quality content in gaming, sports, and tech. Engage with high-quality content and connect with fellow enthusiasts and experts. Explore the latest trends and innovations in our vibrant community. Join us and experience the future today!
Leave a Comment