VS Code Shortcuts for Mac

VS Code Shortcuts for Mac can significantly improve your productivity by helping you navigate, edit, and manage your code efficiently. Whether you’re a beginner or an experienced developer, mastering these shortcuts will speed up your workflow and enhance your coding experience.

General Shortcuts:

  1. Command + Shift + P or F1: Opens the Command Palette, allowing you to search for and execute commands.
  2. Command + P: Quickly search for and open files by typing their names.
  3. Command + Shift + N: Opens a new VS Code window.
  4. Command + Shift + W: Closes the current VS Code window.

Basic Editing:

  1. Command + Shift + P or F1: Opens the Command Palette, allowing you to search for and execute commands.
  2. Command + P: Quickly search for and open files by typing their names.
  3. Command + Shift + N: Opens a new VS Code window.
  4. Command + Shift + W: Closes the current VS Code window.
  5. Command + X: Cuts the entire line without selecting it.
  6. Command + C: Copies the entire line without highlighting it.
  7. Command + V: Pastes the copied or cut content.
  8. Command + Z: Undoes your last action.
  9. Command + Shift + Z: Redoes the action you just undid.
  10. Command + Shift + K: Deletes the entire line.
  11. Command + Enter: Inserts a new line below the current one.
  12. Command + Shift + Enter: Inserts a new line above the current one.
  13. Command + Shift + \: Jumps to the matching bracket, useful for navigating code blocks.
  14. Command + /: Toggles a comment on the current line.
  15. Option + Shift + A: Toggles a block comment around selected code.
  16. Option + Up/Down Arrow: Moves the current line up or down.
  17. Option + Shift + Up/Down Arrow: Duplicates the line and moves the copy up or down.
  18. Command + D: Selects the next occurrence of the highlighted word.
  19. Command + L: Highlights the entire current line.
  20. Command + Shift + L: Selects all instances of the current selection.
  21. Command + F2: Selects every occurrence of the word under the cursor.

Multi-Cursor and Selection:

  1. Option + Click: Adds a new cursor wherever you click, allowing you to type in multiple places simultaneously.
  2. Command + Option + Up/Down Arrow: Adds a new cursor directly above or below the current one.
  3. Command + Shift + Left/Right Arrow: Selects text one word at a time.
  4. Option + Shift + Right/Left Arrow: Expands or reduces the selected text.

Search and Replace:

  1. Command + F: Opens the search bar to find text within the current file.
  2. Command + Option + F: Opens the replace bar to find and replace text within the file.
  3. Command + G / Shift + Command + G: Finds the next or previous occurrence of your search term.
  4. Command + Shift + F: Searches for text across all files in your project.
  5. Command + Shift + H: Replaces text across all files in your project.

Navigation:

  1. Command + T: Shows all symbols (like functions or variables) in the file for quick navigation.
  2. Command + G: Jumps to a specific line number.
  3. Command + Shift + O: Quickly navigates to any symbol in the current file.
  4. Control + – / Control + Shift + -: Moves back or forward to the cursor’s previous or next location.
  5. F12: Jumps directly to the definition of the symbol under the cursor.
  6. Option + F12: Peeks at the definition without leaving the current file.
  7. Command + K, Command + I: Displays a tooltip with more information about the symbol under the cursor.
  8. Command + B: Hides or shows the sidebar.
  9. Command + Shift + E: Opens the Explorer, showing the project’s file structure.
  10. Command + Shift + G: Opens the Source Control view for managing version control (e.g., Git).
  11. Command + Shift + D: Opens the Debug panel to configure and run debugging.
  12. Command + Shift + X: Opens the Extensions panel for managing extensions.
  13. Command + Shift + U: Opens the Output panel for logs and output.
  14. Control + `: Toggles the integrated terminal.

File Management:

  1. Command + N: Creates a new empty file.
  2. Command + O: Opens an existing file.
  3. Command + S: Saves the current file.
  4. Command + Shift + S: Saves the current file with a new name.
  5. Command + Option + S: Saves all currently open files.
  6. Command + W: Closes the current file.
  7. Command + Shift + T: Reopens the last closed file.
  8. Command + K, Command + W: Closes all open files.

Integrated Terminal:

  1. Control + `: Toggles the integrated terminal.
  2. Command + Shift + `: Creates a new terminal instance.
  3. Command + C: Copies selected text in the terminal.
  4. Command + V: Pastes text into the terminal.
  5. Control + Arrow Up/Down: Scrolls through the terminal output history.
  6. Command + K: Clears the terminal output.

Debugging:

  1. F9: Adds or removes a breakpoint on the current line.
  2. F5: Starts or resumes the debugging process.
  3. Shift + F5: Stops the debugging session.
  4. F11 / Shift + F11: Steps into or out of a function during debugging.
  5. F10: Steps over the next function call.

Window Management:

  1. Command + `: Toggles the terminal window.
  2. Command + 1 / 2 / 3: Switches focus to editor group 1, 2, or 3.
  3. Command + K, Command + Left/Right Arrow: Moves between editor groups.
  4. Command + Shift + P: Opens the Command Palette for searching and executing commands.

For additional VS Code tips and tricks, check out my detailed guide on my website DesignWithRehana 📖. Also, explore my YouTube channel🎥 for video tutorials! 🚀

Leave a Comment