How to Toggle Activity Bar in VS Code

This article provides a quick, step-by-step guide on how to show or hide the Activity Bar in Visual Studio Code. You will learn the easiest methods to toggle its visibility using the application menu, the Command Palette, and custom keyboard shortcuts, allowing you to maximize your coding workspace.

Method 1: Using the View Menu

The most straightforward way to show or hide the Activity Bar is through the built-in menu system.

  1. Click on View in the top menu bar.
  2. Hover over Appearance.
  3. Click on Activity Bar (or Show Activity Bar in some versions) to toggle the checkmark. When unchecked, the bar will be hidden.

Method 2: Using the Command Palette

If you prefer using your keyboard, you can quickly toggle the Activity Bar using the Command Palette.

  1. Open the Command Palette using the keyboard shortcut:
    • Windows/Linux: Ctrl + Shift + P
    • macOS: Cmd + Shift + P
  2. Type Toggle Activity Bar Visibility into the search box.
  3. Press Enter to select the option and toggle the bar.

Method 3: Setting a Custom Keyboard Shortcut

Visual Studio Code does not have a default keyboard shortcut assigned to this action, but you can easily create one.

  1. Open the Keyboard Shortcuts editor:
    • Windows/Linux: Ctrl + K, then Ctrl + S
    • macOS: Cmd + K, then Cmd + S
  2. Search for View: Toggle Activity Bar Visibility.
  3. Click the + icon (Add Keybinding) next to the command.
  4. Press the key combination you wish to use (for example, Ctrl + Alt + B or Cmd + Option + B) and press Enter.