Post

C# Development with VS Code — Part 1: Getting Started

C# Development with VS Code — Part 1: Getting Started

Series Overview

This is a 4-part series on productive C# development with Visual Studio Code:

  1. Getting Started (this article) — Installation, UI tour, Git integration, keyboard customisation
  2. Developing C# Apps — Extensions, editing, IntelliSense, NuGet packages
  3. Debugging — Breakpoints, configurations, web app debugging, attach to process
  4. Productivity — Keyboard shortcuts, tasks, workflow optimisation

Why VS Code for C#?

Visual Studio Code is not “Visual Studio Lite.” It’s a professional-grade, cross-platform editor that — with the right extensions — provides a first-class C# and .NET development experience on Windows, macOS, and Linux.

Since .NET became fully cross-platform and tool-independent, VS Code has emerged as the preferred editor for many .NET developers who value speed, flexibility, and keyboard-driven workflows over the heavyweight IDE experience.

Installation

Download VS Code from code.visualstudio.com. The page detects your platform and suggests the right download.

VS Code download page

Download options

Use the Stable Build for production work. The Insiders Build has bleeding-edge features but may be unstable. Both can be installed side-by-side.

Important: During installation, add VS Code to your system PATH. This enables the code command in your terminal, which is essential for the keyboard-driven workflow.

A Brief Tour

When you first open VS Code, you’ll see:

VS Code first launch

The key areas are:

AreaPurposeToggle Shortcut
Sidebar (left)Explorer, search, source control, extensionsCtrl+B / Cmd+B
Editor (centre)Code editing area, supports split viewsCtrl+\ / Cmd+\
Terminal (bottom)Integrated terminalCtrl+`
Command PaletteAccess any command by nameCtrl+Shift+P / Cmd+Shift+P

Create a new file (Ctrl+N), toggle the sidebar (Ctrl+B), and open the terminal (Ctrl+`):

Basic layout

The Command Palette

The Command Palette (Ctrl+Shift+P / Cmd+Shift+P) is the single most important feature in VS Code. Instead of navigating menus, type what you want to do:

Command Palette

Start typing to filter commands. For example, Terminal: Select Default Profile lets you choose your preferred shell:

Select default shell

Quick File Open

Press Ctrl+P / Cmd+P to quickly open any file by typing part of its name — regardless of where it sits in the directory tree:

Quick open

This matches across all subdirectories, so file4.txt is found even inside a nested folder. Get used to this shortcut — it will save you enormous amounts of time.

Opening Folders from the Terminal

Navigate to your project directory in the terminal and run:

1
code -r .
  • code — launches VS Code (requires PATH setup)
  • -r — reuses the current window instead of opening a new one
  • . — opens the current directory

Git Integration

VS Code has built-in Git support. If your directory is a Git repository, the Source Control pane (Ctrl+Shift+G / Cmd+Shift+G) shows changes automatically:

Git integration

Initialising a Repository

Click Initialize Repository or run git init in the terminal. The Source Control pane updates to show untracked files:

Untracked files

Committing Changes

Type a commit message and press Ctrl+Enter. Accept the prompt to auto-stage changes. For pushing, pulling, branching, and more — use the ... menu:

Git operations

GitLens Extension

For a richer Git experience, install GitLens. It adds inline blame annotations, commit history browsing, and much more:

GitLens

Custom Keyboard Shortcuts

You’ll perform some actions frequently — like pushing to Git. Instead of using the Command Palette every time, create a custom shortcut.

Press Ctrl+K then Ctrl+S to open Keyboard Shortcuts:

Keyboard shortcuts

Search for the command you want to bind (e.g., Git: Push):

Search for command

Double-click the command and press your desired key combination. VS Code warns you if the shortcut conflicts with an existing binding:

Conflict warning

You can also use chord shortcuts — two-key sequences like Ctrl+X Ctrl+G:

Chord shortcut

Essential First-Day Shortcuts

ShortcutAction
Ctrl+Shift+P / Cmd+Shift+PCommand Palette
Ctrl+P / Cmd+PQuick file open
Ctrl+B / Cmd+BToggle sidebar
Ctrl+`Toggle terminal
Ctrl+Shift+E / Cmd+Shift+EExplorer pane
Ctrl+Shift+G / Cmd+Shift+GSource control pane
Ctrl+Shift+X / Cmd+Shift+XExtensions pane
Ctrl+, / Cmd+,Settings
Ctrl+K Ctrl+SKeyboard shortcuts

What’s Next

In Part 2: Developing C# Apps, we’ll install the C# extensions, create a .NET project, and explore editing features like IntelliSense, code snippets, quick fixes, and NuGet package management.

This post is licensed under CC BY 4.0 by the author.