Getting Started with VS Code

Visual Studio Codeavailable on macOSLinuxand Windowsis your new traveling companion. Whether you're editing textwriting codeor manipulating datait'll be there for you at every step. In a few minutes - or even less - you'll be ready to code. Let's explore the different options available to you.

Installing VS Code in a Few Clicks

Most of the timeyou'll install VS Code on your main workstation. The simplest way is to use the package manager that comes with your operating systemor even the app store.

Windowsyou can install VS Code directly from the Microsoft Store aka.ms/vscode-msstore in one click. Are you more of a command-line person? You can use WinGetWindows' package manager. Just execute the following command in the terminal:

winget install Microsoft.VisualStudioCode

Tip: WinGet is available by default in some versions of Windows 11. You can learn more about WinGet in the official documentation: https://learn.microsoft.com/windows/package-manager/winget/

Linuxyou can install VS Code using a package. You'll find all package formats (DebianRPMetc.) for your needs on the downloads page code.visualstudio.com. The example below shows how to install the x64 version on a Debian or Ubuntu OS.

wget -O vscode.deb https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64
sudo apt install ./vscode.deb

Learn More: VS Code is also available on Snapsthe app store for Linux. If you're not familiar with Snapsyou can learn more on the official site: https://snapcraft.io/docs/installing-snapd.

Mac: You can download the app from the official website. Thensimply drag and drop the application into your Mac's Applications folder. If you're a HomeBrew user (https://brew.sh)you can install VS Code with the command:

brew install --cask visual-studio-code

Portable Usage

Do you remember "portable apps"? Those applications run from a USB drivewithout installation? Even though this trend has declinedyou can still be the coding superhero without being the administrator of your workstation. Just download the "zip" (or "tar.gz") version of VS Code. You can then simply execute code.exe (or its equivalent depending on your operating system) to work with VS Code.

If you use this version regularlyyou may want to keep your settings between different sessions. In that caseyou will need to create a data (or code-portable-data) folder at the same level as the VS Code executable.

Learn More: You can find more information on the portable version of VS Code on the official website: https://code.visualstudio.com/docs/editor/portable

Using VS Code Without Installing

Are you at a friend's house and need to code quickly? The horrorthere's only Notepad on their computer! FortunatelyVS Code comes to your rescue.

Simply visit the site vscode.dev and you're ready to codewithout installing anything!

vscode.dev

This version of VS Coderunning directly in your browsercan do wonders. It can open a file from your computerafter your permission of courseor access a Git repository.

Did You Know? If you use GitHubyou can use the "github.dev" editor. All you have to do is press the . key on any GitHub repository to launch the editor. You can also visit github.dev

Some limitations exist on this web version. For instancethe integrated terminal or code compilation are unavailable. Some extensions - such as Live Share - are functionalothers are not.

VS Code on Your Servers

Need access to a remote server? No "Remote Desktop" access? No problemVS Code has two super solutions for you: SSH and VS Code Server.

The "Remote - SSH" extension allows you to connect to a remote server via SSH and use VS Code as if you were connected directly. You'll have access to the terminal and remote file system. We'll look more closely at how to install extensions in a later section.

Remote - SSH

Howeverthere are scenarios where you don't have direct SSH access: workstation behind a firewallWindows workstationetc... In this caseyou can use VS Code Server. This mode of VS Code allows you to create a secure tunnel between your workstation and the remote workstation. The connection between the two machines is secured via your GitHub account. Thereforeyou cannot use this tool to share your machine with someone else.

Important: Although VS Code Server does not directly expose your server to the Internetit creates an entry point on your machines. Before using it on such workstations as production serversensure you fully understand the implications for your Threat Model.

To startinstall VS Code CLI on the target workstationlaunch the magic command code tunneland authenticate with GitHub. If you're on a workstation with a visual interface (like your desktop PC)activate the tunnel via the accounts menu.

Once the tunnel is activatedyou can access your target workstation simply from vscode.dev. You can also access it from another workstation using the Remote - Tunnels extension.

Updating VS Code

By defaultVisual Studio Code automatically suggests installing updates as they become available. You can then choose to install it immediately or on the next editor shutdown. Unless you're working with a portable version or have opted to disable this functionupdating VS Code is a breeze.

Nowlet's talk cadence! The teams dedicated to VS Code unveil a minor version every month. To fully enjoy what VS Code has to offerconsider following this monthly rhythm. Some months may have more than one minor versionespecially if there's security vulnerability or a regression. That's why it's strongly recommended to enable automatic updates.

Staying Ahead with the Insider Edition

For the more daringeagerness for new featuresyou can use the "Insider" edition of VS Code. This version is updated daily and gives you access to the latest features before everyone else. Of courseit's like playing with a prototype - it can be a bit risky for production use. But don't worryyou can have this version and the stable version side-by-side on your computer.

You can download the insiders version at https://code.visualstudio.com/insiders/and even access the web version at https://insiders.vscode.dev/.

results matching ""

    No results matching ""