Visual Studio Code
Visual Studio Code (often called VS Code) is a GUI source code editor developed by Microsoft and available for Windows, macOS, and Linux. It is a very popular choice for software development; in a 2023 survey by Stack Overflow, over 73% of respondents reported using VS Code at least some of the time (compared with 22% who reported using the vim text editor).
Visual Studio Code was designed to be language-agnostic, and many language-specific development features (such as build automation; debugger support; or unit testing) are provided by installing plugins which extend the functionality of the editor. This allows you to customize VS Code to the language and tools you work with.
The instructions below will help you install VSCode on your macOS or Windows computer; once installed, the process of configuring VSCode for a particular language (by installing specific plugins) is the same on all platforms.
VSCode, like vim, is a source code editor; while it can run other programming tools (like a compiler) for you, you must install such tools separately in order to use them.
Microsoft also makes Visual Studio, an integrated development environment (or IDE), which bundles a code editor, compiler, debugger, and many other tools in a single installation. Using an IDE can simplify the process of setting up a development environment, but can also limit your abiility to customize your development toolchain.
Installing Visual Studio Code on macOS
There are a few different ways to install Visual Studio Code on your macOS system, depending on your preferred method of installing GUI programs.
Installing Visual Studio Code with Homebrew
You can use Homebrew to install Visual Studio Code with the following formula:
Homebrew formula for VSCode
$ brew install --cask visual-studio-code
Installing Visual Studio Code by direct download
If you prefer to download and install Visual Studio Code by hand, you can do so by following these steps:
- Visit the VSCode Download page
- Click the large "MacOS" button to initiate a download for your computer (or select one of the links underneath to choose a specific version of the installer .zip)
- Extract the .zip file to get the "Visual Studio Code.app" file.
- Drag the .app file to your "Applications" folder to make it available in your Launchpad
- If you want to launch VSCode from a Terminal (e.g, by typing
code .
to open a directory for editing) then you'll need to add VSCode to your $PATH- Open VSCode (e.g., through Launchpad)
- Open the "Command Palette" by pressing Cmd+Shift+P
- Search for "Shell Command: Install 'code' command in PATH" (typically, typing "shell command" will return this as one of the options) and click the command to run it.
Installing Visual Studio Code on Windows
There are a few different ways to install Visual Studio Code on your Windows system, depending on your preferred method of software installation.
Installing Visual Stuio Code with winget
You can use the Windows Package Manager to install Visual Studio Code with the following command:
VSCode installation with winget
> winget install --id Microsoft.VisualStudioCode -e
Installing Visual Studio Code with a downloadable installer
If you prefer to download and run an installer program for Visual Studio Code, you can do so by following these steps:
- Visit the VSCode Download page
- Click the large "Windows 10, 11" button to initiate a download for your computer (or select one of the links underneath to choose a specific version of the installer)
- Run the installer program to complete the installation