Get AI summaries of any video or article — Sign up free
25 VS Code Productivity Tips and Speed Hacks thumbnail

25 VS Code Productivity Tips and Speed Hacks

Fireship·
5 min read

Based on Fireship's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.

TL;DR

Use the VS Code CLI “code” command to open directories/files from the terminal instead of relying on the file explorer.

Briefing

VS Code speed comes down to one practical shift: stop treating the editor like a point-and-click app and start using keyboard-driven navigation, editing, and automation. The payoff is immediate—fewer context switches, less scrolling, and faster iteration—without needing to switch to extreme editor workflows like Vim or Emacs.

A core starting point is opening projects efficiently. Instead of using the file explorer, the command-line “code” command can open directories or edit files directly; on macOS and Linux it requires adding the VS Code binary to the PATH first. Once inside the editor, the biggest productivity lever is reducing mouse reliance. Nearly every action available through menus and buttons can be triggered from the keyboard, and learning a small set of shortcuts—roughly 10 to 20—can change day-to-day speed.

The command palette (opened with Ctrl+P) acts as the central control surface. It can jump to recently opened files, search by filename, and—when typed with a “>” style query—surface virtually any command, including extension commands. For example, the “Quokka” extension can run JavaScript directly in the editor: it executes code in the background and appends output inline, enabling rapid prototyping without constantly switching to a separate runner.

Navigation and editing shortcuts then cut out the most common time sinks. Ctrl+F finds text in the current file, but symbol-level navigation is faster: using the “@” query in the command palette lists symbols across the project for quick jumps. For line-based edits, Ctrl+G (followed by a line number) moves the cursor precisely, while Ctrl+D repeated selects the next occurrence of the current selection—turning one edit into many. Multi-cursor editing is also a major accelerator: Alt+click creates cursors in multiple locations, which is especially useful for repetitive patterns like CSS properties or matching HTML tag edits. The Auto Rename Tag extension can automatically keep opening and closing tags synchronized.

Editing flow extends into cut/copy, commenting, and formatting. Ctrl+X cuts the current line without highlighting; Alt+Up/Down moves the line, and Alt+Shift+Up/Down copies it while moving. For comments, Ctrl+/** toggles comment blocks on selected code instead of manually prefixing each line. For JavaScript documentation-style comments, the “Add js.com” extension can generate structured comments from selected functions, and “Better Comments” adds visual emphasis—lines starting with “!” turn red and TODOs become orange.

Beyond editing, VS Code’s terminal and Git tooling reduce friction. Ctrl+` opens a terminal in the current working directory, and multiple sessions can be renamed and color-coded for clarity. Ctrl+K clears the terminal after an error, and the up arrow reruns the last command. Repeated commands like “npm run test” can be replaced with VS Code tasks (JSON-defined) invoked from the command palette. For version control, the Source Control tab supports staging via point-and-click, with icons indicating modified/added/removed files; Git Lens adds deeper visualization and blame attribution. Finally, remote workflows can eliminate cloning overhead via GitHub remote repositories, plus remote SSH and remote containers for server and Docker-based development.

The remaining productivity gains come from reducing boilerplate and safer refactors. Custom snippets (configured via “Configure User Snippets”) let developers insert repeated templates quickly, while framework-specific snippet extensions may already exist. For schema work in TypeScript, the “JSON to TS” (quicktype-based) approach can infer types from JSON. When renaming, avoid risky project-wide find/replace; instead, use “Find all references” and “Rename Symbol” to update identifiers safely across files.

Cornell Notes

Speed in VS Code hinges on keyboard-first workflows and small, high-impact habits. The command palette (Ctrl+P) centralizes file navigation and command execution, including extension actions like Quokka’s inline JavaScript output. Symbol search and precise cursor movement (using @ for symbols and Ctrl+G for line jumps) prevent time-wasting scrolling. Editing accelerators—Ctrl+D for repeated selections, Alt+click for multi-cursors, and Ctrl+/** for comment toggling—turn single changes into batch edits. Automation and tooling (tasks, terminal shortcuts, Source Control staging, Git Lens, and remote repository/SSH/container extensions) reduce repetitive setup and make iteration faster and safer.

Why does the command palette matter more than memorizing lots of shortcuts?

Ctrl+P opens the command palette and provides multiple layers of power: it lists recently opened files, supports typing a filename to jump directly, and—when using the “>” style query—surfaces virtually any VS Code command, including extension commands. That means a developer can discover capabilities on demand instead of memorizing every keybinding. It also enables extension workflows like starting/stopping Quokka from the keyboard.

What’s the fastest way to navigate to code without scrolling in large files?

For text, Ctrl+F works within the current file, but for structure-level navigation the command palette’s “@” query is faster because it lists symbols across the codebase. Another shortcut, Ctrl+G, jumps to a specific line number. Together, these avoid scanning long files and reduce the time spent hunting for functions or interfaces.

How do multi-cursor and repeated selection shortcuts change editing speed?

Ctrl+D selects the next occurrence of the current selection, and repeating it can expand one edit into many simultaneous edits—effectively turning a single change into a batch operation. Alt+click creates multiple cursors at different locations, which is ideal for repetitive edits like CSS properties or aligning edits across similar lines. For HTML, Auto Rename Tag can automatically synchronize opening and closing tags when the opening tag changes.

What shortcuts streamline common editing tasks like cutting, moving, and commenting?

Cutting the current line doesn’t require highlighting: Ctrl+X cuts immediately when the cursor is on the line. Moving lines uses Alt+Up/Down, and copying while moving uses Alt+Shift+Up/Down. For comments, Ctrl+/** toggles comment syntax on selected code, preventing the slow process of manually prefixing each line.

How does VS Code reduce repetition in the terminal and in Git workflows?

Terminal repetition can be reduced with tasks: define commands in a JSON task configuration and run them from the command palette, avoiding repeated typing of commands like “npm run test.” For Git, the Source Control tab supports staging via point-and-click, with icons indicating modified/added/removed files. Git Lens adds visualization and blame attribution to make debugging and collaboration easier.

How can remote development features remove the need for local cloning and setup?

Remote repositories (via a VS Code extension) allow logging into GitHub and contributing to repos without cloning locally. The workflow supports creating branches, editing code, and submitting pull requests from within VS Code. Additional remote options include remote SSH for servers and remote containers for Docker-based development environments, managed through Microsoft-managed extensions.

Review Questions

  1. Which command palette query would you use to jump to symbols rather than filenames, and why is it faster in large codebases?
  2. Describe a workflow that uses Ctrl+D and multi-cursor editing to modify repeated code patterns in one pass.
  3. When should a developer prefer tasks over repeatedly typing terminal commands, and what’s the role of the command palette in running those tasks?

Key Points

  1. 1

    Use the VS Code CLI “code” command to open directories/files from the terminal instead of relying on the file explorer.

  2. 2

    Adopt keyboard-first habits: most mouse actions have keyboard equivalents, and learning a small set of shortcuts yields outsized gains.

  3. 3

    Rely on the command palette (Ctrl+P) as a discovery tool for commands and extension actions, not just a file switcher.

  4. 4

    Speed up navigation by using @ symbol search for symbols across the project and Ctrl+G for precise line jumps.

  5. 5

    Turn single edits into batch edits with Ctrl+D (repeated selection) and Alt+click (multi-cursors), and use Auto Rename Tag to keep paired tags consistent.

  6. 6

    Replace repetitive terminal commands with VS Code tasks so commands like “npm run test” run from the command palette.

  7. 7

    Use Source Control staging and Git Lens to reduce Git command memorization and improve debugging with blame attribution.

Highlights

Quokka can execute JavaScript in the background and append output inline, enabling rapid prototyping without leaving the editor.
Ctrl+D repeated selection and Alt+click multi-cursors can convert one edit into many simultaneous changes.
Ctrl+/** toggles comments on selected code, avoiding line-by-line manual commenting.
VS Code tasks let developers replace repeated terminal commands with reusable, named JSON configurations.
Remote repositories, remote SSH, and remote containers can turn VS Code into a full development environment without local cloning.

Topics

  • Command Palette
  • Multi-Cursor Editing
  • Terminal Tasks
  • Source Control
  • Remote Development

Mentioned

  • VS Code
  • CLI
  • PATH
  • macOS
  • Linux
  • Ctrl
  • Git
  • npm
  • JSON
  • TODO
  • SSH
  • Docker
  • Wsl