Graphite Reviewer is now Diamond

Essential Visual Studio Code keyboard shortcuts for faster coding

Greg Foster
Greg Foster
Graphite software engineer
Try Graphite

Using Visual Studio Code effectively involves mastering key shortcuts that streamline your workflow and enhance your coding efficiency. Here is a comprehensive guide to essential VS Code shortcuts, complete with clear examples, designed to boost your productivity.

These VS Code shortcuts are fundamental and frequently used:

  • Copy line up/down:

    • Shortcut: Shift + Alt + Up/Down
    • Example: Duplicate the current line above or below without copying and pasting.
  • Move line up/down:

    • Shortcut: Alt + Up/Down
    • Example: Quickly move the selected line or block of code.
  • Comment/Uncomment lines:

    • Shortcut: Ctrl + /
    • Example: Instantly comment out or uncomment lines of code.

Navigate efficiently through your codebase with these shortcuts:

  • Go to file:

    • Shortcut: Ctrl + P
    • Example: Quickly open files by typing partial filenames.
  • Go to definition:

    • Shortcut: F12
    • Example: Jump directly to the definition of a function or variable.
  • Peek definition:

    • Shortcut: Alt + F12
    • Example: Preview definitions without navigating away from your current position.

Enhance your coding workflow with these productivity-focused shortcuts:

  • Quick command palette:

    • Shortcut: Ctrl + Shift + P
    • Example: Access all commands in VS Code, including extensions like Graphite VS Code extension, which provides improved commit history visualization and branch management.
  • Open integrated terminal:

    • Shortcut: Ctrl + ~
    • Example: Quickly toggle the built-in terminal without leaving the editor.
  • Format document:

    • Shortcut: Shift + Alt + F
    • Example: Instantly format your entire document according to your project's formatting rules.

Effectively manage selections with these shortcuts:

  • Select word:

    • Shortcut: Ctrl + D
    • Example: Quickly select words matching the current selection to modify simultaneously.
  • Multi-cursor editing:

    • Shortcut: Alt + Click
    • Example: Place multiple cursors in different locations for simultaneous editing.

Leverage these advanced shortcuts for superior productivity:

  • Toggle sidebar visibility:

    • Shortcut: Ctrl + B
    • Example: Quickly toggle the visibility of the sidebar to maximize coding space.
  • Search across files:

    • Shortcut: Ctrl + Shift + F
    • Example: Perform a project-wide search for quick code refactoring or locating code snippets.

The Graphite VS Code extension offers additional productivity hacks like enhanced Git workflows, efficient stack management, and simplified branch operations. Shortcuts and commands provided by this extension integrate seamlessly into your existing workflow.

By consistently utilizing these shortcuts, you'll find yourself coding more efficiently, reducing time spent on repetitive tasks, and ultimately becoming a more productive developer.

Built for the world's fastest engineering teams, now available for everyone