Post

C# Development with VS Code — Part 4: Productivity

C# Development with VS Code — Part 4: Productivity

Series Overview

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

The Keyboard-Driven Philosophy

The fastest developers in VS Code rarely touch the mouse. Every action — opening files, running builds, navigating code, refactoring — has a keyboard shortcut. This article is a reference guide for the shortcuts and task configurations that make the biggest difference for C# development.

IDE Layout

VS Code layout reference

ShortcutAction
Ctrl+J / Cmd+JToggle Panel (terminal, output, problems)
Ctrl+B / Cmd+BToggle Sidebar
Ctrl+0 / Cmd+0Focus Sidebar
Ctrl+Alt+B / Cmd+Alt+BToggle Secondary Sidebar
F11Toggle Full Screen
Ctrl+K ZToggle Zen Mode (distraction-free)
Escape EscapeExit Zen Mode

View Switching

ShortcutView
Ctrl+Shift+E / Cmd+Shift+EExplorer
Ctrl+Shift+X / Cmd+Shift+XExtensions
Ctrl+Shift+F / Cmd+Shift+FSearch
Ctrl+Shift+D / Cmd+Shift+DDebug
Ctrl+Shift+G G / Cmd+Shift+G GGit / Source Control

Panel Tabs

ShortcutTab
Ctrl+Shift+M / Cmd+Shift+MProblems
Ctrl+Shift+Y / Cmd+Shift+YDebug Console
Ctrl+Shift+U / Cmd+Shift+UOutput
Ctrl+` / Cmd+`Terminal
Ctrl+Shift+VMarkdown Preview

Editor Management

Splitting Views

Split the editor with Ctrl+\ / Cmd+\. There’s no limit on splits, but 2-3 is practical.

Switch between editor groups with Ctrl+1, Ctrl+2, Ctrl+3, or use Ctrl+PageUp/Ctrl+PageDown to cycle through tabs across groups.

Moving Files Between Groups

ShortcutAction
Ctrl+Alt+RightMove file to right editor group
Ctrl+Alt+LeftMove file to left editor group
Ctrl+W / Cmd+WClose current tab
Ctrl+K Ctrl+W / Cmd+K Cmd+WClose all tabs

Code Navigation

ShortcutAction
Ctrl+P / Cmd+PQuick file open
Ctrl+TShow all symbols in workspace
Ctrl+Shift+OGo to symbol in current file
Ctrl+GGo to line number
F12Go to Definition
Alt+F12Peek Definition (inline)
Shift+F12Find all References
F8Next error/warning
Shift+F8Previous error/warning

Editing

Selections

ShortcutAction
Ctrl+DSelect current word (repeat to select next occurrence)
Ctrl+LSelect current line
Ctrl+Shift+LSelect all occurrences of current selection
Ctrl+Shift+Alt+Down/UpColumn (box) select

Line Operations

ShortcutAction
Alt+Down / Alt+UpMove line down/up
Shift+Alt+Down / Shift+Alt+UpCopy line down/up
Ctrl+C (empty selection)Copy entire line
Ctrl+Shift+KDelete line

Formatting & Refactoring

ShortcutAction
Shift+Alt+FFormat document
Ctrl+. / Cmd+.Quick fix / code actions
F2Rename symbol
Ctrl+Shift+RRefactor selected code

IntelliSense Shortcuts

ShortcutAction
Ctrl+SpaceTrigger IntelliSense
Ctrl+K Ctrl+I / Cmd+K Cmd+IShow hover info
Ctrl+. / Cmd+.Quick actions (add using, etc.)

Terminal Productivity

ShortcutAction
Ctrl+`Toggle terminal
Ctrl+Shift+5 / Cmd+Shift+5Split terminal
Ctrl+Shift+ ``Create new terminal

Debugging Shortcuts

ShortcutAction
F9Toggle breakpoint
F5Start / Continue debugging
Ctrl+F5Start without debugging
Shift+F5Stop debugging
F10Step over
F11Step into
Shift+F11Step out
F6Pause

Testing Shortcuts

ShortcutAction
Alt+R Alt+ARun all tests (Test Explorer)
Alt+R Alt+CRun tests in current file

Creating Files & Folders

ActionShortcut
Navigate to ExplorerCtrl+Shift+E
New file in folderAlt+F Alt+N (after selecting folder)
New folderAlt+F Alt+F
New C# classRight-click > New C# Class

Build Shortcut

If you’ve configured a default build task in tasks.json, press Ctrl+Shift+B to run it instantly.

Tasks

Tasks in VS Code let you run scripts and commands without leaving the editor. They’re configured in .vscode/tasks.json.

Basic Structure

1
2
3
4
{
  "version": "2.0.0",
  "tasks": []
}

Essential .NET Tasks

Here’s a complete tasks.json for a C# solution:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "build",
      "command": "dotnet",
      "type": "process",
      "group": { "kind": "build", "isDefault": true },
      "args": [
        "build",
        "${workspaceFolder}/MySolution.sln",
        "/property:GenerateFullPaths=true",
        "/consoleloggerparameters:NoSummary"
      ],
      "problemMatcher": "$msCompile"
    },
    {
      "label": "test",
      "command": "dotnet",
      "type": "process",
      "group": { "kind": "test", "isDefault": true },
      "args": ["test", "${workspaceFolder}/MySolution.sln"],
      "problemMatcher": "$msCompile"
    },
    {
      "label": "clean",
      "command": "dotnet",
      "type": "process",
      "args": ["clean", "${workspaceFolder}/MySolution.sln"],
      "problemMatcher": "$msCompile"
    },
    {
      "label": "format",
      "command": "dotnet",
      "type": "process",
      "args": ["format"],
      "problemMatcher": "$msCompile"
    },
    {
      "label": "format verify",
      "command": "dotnet",
      "type": "process",
      "args": ["format", "--verify-no-changes"],
      "problemMatcher": "$msCompile"
    },
    {
      "label": "restore",
      "command": "dotnet",
      "type": "process",
      "args": ["restore", "${workspaceFolder}/MySolution.sln", "--force"],
      "problemMatcher": "$msCompile"
    },
    {
      "label": "publish",
      "command": "dotnet",
      "type": "process",
      "args": [
        "publish",
        "${workspaceFolder}/MySolution.sln",
        "-c", "Release",
        "-r", "linux-arm64"
      ],
      "problemMatcher": "$msCompile"
    }
  ]
}

Key Concepts

Default Build Task: Setting "group": { "kind": "build", "isDefault": true } lets you trigger the task with Ctrl+Shift+B.

Default Test Task: Setting "kind": "test", "isDefault": true makes it the default test task.

Problem Matcher: "$msCompile" tells VS Code to parse the output for errors and show them in the Problems panel (Ctrl+Shift+M).

Running Tasks

MethodHow
Default buildCtrl+Shift+B
Any taskCtrl+Shift+P → “Tasks: Run Task”
TerminalCommand Palette → “Terminal: Run Task”

Putting It All Together: A Workflow

Here’s a typical development cycle using only the keyboard:

  1. Ctrl+Shift+E — Open Explorer, navigate to file
  2. Ctrl+P — Quick-open a specific file
  3. Edit code using snippets (prop, ctor, cw)
  4. Ctrl+. — Fix missing usings
  5. Ctrl+Shift+B — Build
  6. F8 — Jump to any errors
  7. F5 — Start debugging
  8. F9 — Toggle breakpoints as needed
  9. F10 / F11 — Step through code
  10. Shift+F5 — Stop debugging
  11. Alt+R Alt+A — Run all tests
  12. Ctrl+Shift+G G — Open Source Control
  13. Type commit message → Ctrl+Enter — Commit

Zero mouse clicks. Maximum flow.

Print or bookmark this condensed reference:

1
2
3
4
5
6
7
8
9
10
11
12
NAVIGATION          EDITING             DEBUGGING
Ctrl+P    file      Ctrl+D    word      F5     start/continue
Ctrl+T    symbol    Alt+Up    move up   F9     breakpoint
Ctrl+G    line      Alt+Down  move dn   F10    step over
F12       go def    Shift+Alt format    F11    step into
Ctrl+.    quickfix  Ctrl+L    sel line  Sft+F5 stop

VIEWS               TASKS               TERMINAL
Ctrl+B    sidebar   Ctrl+Sft+B build    Ctrl+` toggle
Ctrl+J    panel     Alt+R A   test all  Ctrl+Sft+5 split
Ctrl+Sft+E explore  F8        next err
Ctrl+Sft+D debug    Ctrl+Sft+M problems

Series Conclusion

Over this 4-part series we’ve covered everything you need to be productive with C# in VS Code:

  1. Getting Started — Installation, UI fundamentals, Git integration
  2. Developing — Extensions, IntelliSense, code snippets, NuGet
  3. Debugging — Breakpoints, configurations, web apps, attach to process
  4. Productivity — Keyboard shortcuts, tasks, and zero-mouse workflows

VS Code with C# Dev Kit is a genuine alternative to Visual Studio — lighter, faster, cross-platform, and just as capable for day-to-day C# development. The key is investing time in learning the keyboard shortcuts. Once they become muscle memory, you’ll wonder how you ever worked without them.

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