Lesson 3 / 838%

Lesson 3

The VS Code Interface

18 min

Activity bar, explorer, editor area and status bar: find your way around the editor.

Definition

The interface of a piece of software is the set of visual elements (areas, menus, icons, panels) through which you communicate with it. The VS Code interface is organized into several complementary areas: the Activity Bar, the Side Bar, the editor area, the bottom panel and the Status Bar.

Overview of the interface

Before you start writing code, it is important to find your way around the VS Code interface. Even if it may seem dense at first, it is actually split into a few well-defined main areas, which appear in (almost) all modern code editors.

Good news: you don't need to memorize everything right away. With a few hours of practice, you will navigate these areas without even thinking about it, much like you can find the buttons of a web browser today. What matters for now is knowing what each area is called and what it is for, so that you can follow the next lessons without getting lost.

VS Code interface layout
  • The Activity Bar (far left, vertical): a thin column of icons that lets you switch between the different views (Explorer, Search, Source Control, Run and Debug, Extensions...).
  • The Side Bar: the large panel displayed next to the Activity Bar, whose content changes depending on the selected icon. By default, it shows the file explorer.
  • The editor area: the central, largest area, where the content of the open files is displayed, each in its own tab.
  • The bottom panel: hidden by default, it groups the integrated terminal, the debug console, the problems detected in the code ("Problems") and the output of extensions ("Output").
  • The Status Bar: at the very bottom, it displays contextual information (language of the active file, cursor position, encoding, current Git branch...).

The Activity Bar in detail

The icons of the Activity Bar are your compass in VS Code. From top to bottom, the default icons are generally:

  • Explorer (icon of overlapping sheets): lists the files and folders of your open project.
  • Search (magnifying glass): searches and replaces text across all the files of the project, not just in the open file.
  • Source Control (branch-shaped icon): shows the changes tracked by Git and lets you commit changes.
  • Run and Debug (play icon with a bug): lets you run and debug your code step by step.
  • Extensions (icon of assembled blocks): the extensions "store" used to enrich VS Code, which you will discover in an upcoming lesson.

Clicking an icon that is already selected closes the Side Bar; a second click reopens it. This saves screen space when you want to focus only on your code.

At the bottom of this same bar, you will find two additional icons: theAccounts menu, used to sign in to synchronize your settings across several computers, and the Manage gear, which gives access to settings, keyboard shortcuts and themes. You can also use theCtrl/Cmd + B shortcut to show or hide the Side Bar without using the mouse.

The Side Bar and the Explorer

The view you will use most often is the Explorer. It shows the tree structure of your project: folders can be expanded or collapsed with a click, and a simple click on a file opens it in the editor area. A right-click on an item brings up a menu that lets you create a new file or folder, rename, delete or copy the path of a file.

If the Explorer shows an "Open Folder" button, it means no project is open yet. In VS Code, you almost always work on an entire folder rather than on an isolated file: this is what allows the editor to understand the structure of your project and offer you relevant suggestions.

The editor area and tabs

Each file you open appears as a tab at the top of the editor area, as in a web browser. A white dot (or a filled circle depending on the theme) on a tab indicates that the file contains unsaved changes. You can split the editor area into several columns to see two files side by side, very handy for comparing code or working on an HTML file and its associated CSS file at the same time.

A few useful gestures: Ctrl/Cmd + S saves the active file, Ctrl/Cmd + W closes the current tab, and Ctrl/Cmd + P lets you open a project file very quickly by simply typing part of its name. On the right of the editor area, a mini-map of the file (the "minimap") offers a reduced view of the code to navigate quickly in long files.

The bottom panel

The bottom panel stays hidden until you need it. To display it, use the menuView → Terminal or the shortcut Ctrl + ` (the backtick key). It contains several tabs: theterminal, to run commands, Problems, which lists the errors and warnings spotted in your code, Output, which displays messages from extensions, and the Debug Console. Keep an eye on the problems counter: a red number generally signals an error to fix.

The Command Palette

More than an area of the interface, the Command Palette is a true universal search tool. Open it with Ctrl/Cmd + Shift + P, then start typing what you want to do: change the theme, open the settings, format the document... VS Code offers you the matching actions. When you can't find a feature in the menus, try the palette: it is often the fastest route.

The menu bar

At the very top of the window, the menu bar groups the classic actions of a piece of software: File, Edit, Selection, View, Go, Run, Terminal and Help. On Mac, it is located in the system bar at the top of the screen, as with other applications. The File menu lets you, for example, open a folder or save your work, while theView menu is used to show or hide each area of the interface.

Organizing your workspace

All the areas of the interface are adjustable. You can widen the Side Bar or the bottom panel by dragging their border with the mouse, and even move a view from one place to another by drag and drop. If you are short on space, you can also enlarge or shrink the text with Ctrl/Cmd + + and Ctrl/Cmd + -.

To focus as much as possible, VS Code offers a distraction-free mode, calledZen Mode, which hides almost all the elements of the interface to leave only your code. Activate it from the Command Palette by searching for "Zen Mode", then press Esc twice to exit it. It is ideal for writing code without being disturbed.

The Status Bar

Discreet but very useful, the bar at the very bottom of the window (blue in the default dark theme) permanently displays information about the active file: the detected language (for example "HTML" or "JavaScript"), the line and column number where your cursor is, the file encoding (generally UTF-8), and — if your folder is a Git repository — the name of the currently active branch.

It is also interactive: a click on the language lets you change it manually, a click on the encoding lets you reopen the file with another format, and a click on the Git branch name opens the list of available branches.

Depending on the installed extensions, other information may be added: the state of automatic formatting, the Python version in use, or synchronization indicators. Get into the habit of glancing at it regularly, because it often saves you from looking elsewhere for essential information.

How to get used to the interface quickly

The best way to make the interface your own is to explore it without fear. Nothing you do by opening panels, switching views or moving elements can damage your code. At worst, a panel disappears or changes place, and you can find it again via the View menu.

  • Get into the habit of using shortcuts: learn one or two a day, such as Ctrl/Cmd + S or Ctrl/Cmd + P, rather than learning everything at once.
  • Use the Command Palette whenever you are unsure where a feature is located.
  • Always open a folder rather than an isolated file, to benefit from the full power of the Explorer.

Good to know

You can customize the VS Code color theme via File → Preferences → Theme → Color Theme (or Code → Settings → Theme → Color Theme on Mac; the exact menu name may vary slightly between versions). Choose a light or dark theme according to your visual comfort — it has no impact on how things work, only on the appearance!

Exercise

Open VS Code, then click in turn on each of the icons in the Activity Bar to see how the content of the Side Bar changes. Then try closing and reopening the Side Bar by clicking twice on the same icon.

Going further

Open the theme picker (Ctrl/Cmd + K then Ctrl/Cmd + T) and try at least three different color themes before choosing the one you prefer for the rest of the course.