Wednesday, November 27, 2024

Visual Studio Productivity Keyboard Shortcuts

I give credit to GitHub Copilot for this recommendation question.  I followed my curiosity and found it worth posting for myself or anyone else who finds it useful.

Here are some of the most common keyboard shortcuts for efficient coding in Visual Studio 2022:

General Shortcuts

Ctrl + Shift + P: Open the Command Palette

Ctrl + ,: Quick Open (Navigate to a file)

Ctrl + Shift + N: New Project

Ctrl + O: Open File

Ctrl + S: Save

Ctrl + Shift + S: Save All

Ctrl + F4: Close Document

Ctrl + Shift + F4: Close All Documents

Editing

Ctrl + X: Cut

Ctrl + C: Copy

Ctrl + V: Paste

Ctrl + Z: Undo

Ctrl + Y: Redo

Ctrl + K, Ctrl + C: Comment Selection

Ctrl + K, Ctrl + U: Uncomment Selection

Ctrl + D: Duplicate Line

Ctrl + K, Ctrl + D: Format Document

Navigation

Ctrl + -: Navigate Backward

Ctrl + Shift + -: Navigate Forward

Ctrl + T: Go to All

F12: Go to Definition

Ctrl + F12: Go to Implementation

Shift + F12: Find All References

Ctrl + K, Ctrl + N: Go to Next Bookmark

Ctrl + K, Ctrl + P: Go to Previous Bookmark

Debugging

F5: Start Debugging / Continue

Shift + F5: Stop Debugging

F9: Toggle Breakpoint

F10: Step Over

F11: Step Into

Shift + F11: Step Out

Search

Ctrl + F: Find

Ctrl + H: Replace

Ctrl + Shift + F: Find in Files

Ctrl + Shift + H: Replace in Files

Refactoring

Ctrl + .: Quick Actions and Refactorings

Ctrl + R, Ctrl + R: Rename

Ctrl + R, Ctrl + G: Extract Method

These shortcuts can significantly enhance your productivity by allowing you to perform common tasks quickly without taking your hands off the keyboard.


No comments: