VS Code Shortcuts for macOS - Essential Keyboard Commands

Master VS Code on macOS with our comprehensive list of essential keyboard shortcuts. Boost your productivity with these time-saving commands for editing, navigation, and more.

VS Code Shortcuts for macOS

Mastering VS Code on macOS: Essential Shortcuts for Enhanced Productivity

Visual Studio Code (VS Code) is a powerful and popular code editor, and mastering its keyboard shortcuts can significantly boost your development workflow on macOS. This guide provides a comprehensive list of essential VS Code shortcuts tailored for Mac users, covering navigation, editing, multi-cursor functionality, and more.

Side Menu Navigation

Quickly access and manage VS Code's various panels and views using these shortcuts:

Shortcut Description
⌘ + B Toggle Side Bar visibility
⌘ + ⇧ + E Open the Explorer view
⌘ + ⇧ + F Open the Search view
⌘ + ⇧ + J Open the Find in Files view
⌃ + ⇧ + G Open the Source Control (Git) view
⌘ + ⇧ + D Open the Debug view
⌘ + ⇧ + X Open the Extensions view

Efficient Multi-Cursor Editing

Streamline repetitive editing tasks with VS Code's multi-cursor capabilities:

Shortcut Description
⌘ + ⌥ + ↓ Add a new cursor below the current line
⌥ + Click Add a new cursor at the clicked location
⌘ + ⇧ + L Select all occurrences of the current selection and add cursors

Splitting and Managing Editors

Organize your workspace by splitting the editor and navigating between split panes:

Shortcut Description
⌘ + \ Split the editor

Window and Panel Focusing

Effortlessly switch focus between different VS Code windows, editors, and integrated terminals:

Shortcut Description
⌘ + 0 Focus on the Explorer panel
⌘ + 1 Focus on the first editor split window
⌘ + 2 Focus on the second editor split window
⌃ + ~ Toggle the integrated terminal
^ + tab Switch between editor tabs
⌘ + ~ Switch between VS Code editor windows

IntelliSense and Code Completion

Leverage VS Code's intelligent code completion to write code faster and with fewer errors:

Shortcut Description
⌃ + Space Trigger IntelliSense suggestions

Line Manipulation and Editing

Perform common line operations like copying, moving, and deleting with these shortcuts:

Shortcut Description
⇧ + ⌥ + ↓ Copy the current line and insert it below
⇧ + ⌥ + ↑ Copy the current line and insert it above
⌥ + ↓ Move the current line down
⌥ + ↑ Move the current line up
⌘ + ⇧ + K Delete the current line

Rename Symbol Refactoring

Easily rename variables, functions, and other symbols across your project:

Shortcut Description
F2 (Fn + F2) Rename Symbol in the current project
Right Mouse Click -> Rename Symbol Rename Symbol in the current project

Code Formatting

Keep your code clean and consistent with VS Code's built-in formatting tools:

Shortcut Description
⇧ + ⌥ + F Format the entire document
⌘ + K then ⌘ + F Format selected text

Transform Selected Text Case

Quickly change the case of selected text to various formats:

Shortcut Description
^ + ⇧ + ⌥ + L Transform selected text to lowercase
^ + ⇧ + ⌥ + U Transform selected text to uppercase
^ + ⇧ + ⌥ + S Transform selected text to snake_case
^ + ⇧ + ⌥ + T Transform selected text to TitleCase

Code Folding and Unfolding

Manage code readability by folding and unfolding code blocks:

Shortcut Description
⌘ + ⌥ + [ Fold the current code block
⌘ + ⌥ + ] Unfold the current code block
⌘ + K then ⌘ + 0 Fold all code blocks
⌘ + K then ⌘ + J Unfold all code blocks
⌘ + K then ⌘ + 1 Fold code blocks to level 1
⌘ + K then ⌘ + 2 Fold code blocks to level 2
⌘ + K then ⌘ + 5 Fold code blocks to level 5

Navigating Errors and Warnings

Quickly jump between errors and warnings in your code:

Shortcut Description
F8 Navigate to the next error or warning

By integrating these VS Code shortcuts into your daily development routine on macOS, you can significantly enhance your efficiency and focus more on writing great code.