1. Shortcuts for searching and navigating through source code:
Ctrl + Q
: Displays Visual Studio SearchCtrl + T
: Displays the Go To All toolCtrl + -
: Navigates backward between opened documents in the current sessionCtrl + Shift + -
: Navigates forward between opened documents in the current sessionF12
: Navigates to a class definitionAlt + F12
: Allows you to view and edit the code of a class in a pop-up window, from the code file you are writing.Ctrl + F12
: Navigates to the implementation of a member in a classCtrl + Shift + F12
: Moves to the next error line when the error list window is open and more than one error is listedF8
: Navigates forward in the list of results of the current windowShift + F8
: Navigates backward in the list of results of the current window2. Shortcuts for editing and refactoring:
Alt + Enter
: Displays quick actionsCtrl + K, Ctrl + I
: Obtains information about a member of a classCtrl + K, Ctrl + C
: Comments multiple selected lines in the source codeCtrl + K, Ctrl + U
: Uncomments multiple selected lines in the source codeCtrl + Shift + L:
Deletes selected linesCtrl + Shift + V
: Displays and allows pasting the contents from the buffer ring (it refers to the history of elements that have been previously copied)Ctrl + F
: Finds a specific text in the codeCtrl + A
: Selects all the lines in the current fileCtrl + S
: Saves the pending changes in the current fileCtrl + Shift + S
: Saves the pending changes in all the opened filesCtrl + Shift +. :
Zooms into the current fileCtrl + Shift +,:
Zooms out from the current fileCtrl + Up
: Moves selected lines up in a code fileCtrl + Down:
Moves selected lines down in a code fileCtrl + K, Ctrl + D:
Applies the style rules to the entire documentCtrl + K, Ctrl + F:
Applies the style rules only in the selected lines in the documentCtrl + K, Ctrl + S:
Used to encapsulate the code between common clauses, such as cycles (while, for, and so on), control statements (if, switch, and so on), or code regions (#region).Ctrl + R:
Renames a memberCtrl + R, Ctrl + E:
Creates a property for a field of a classCtrl + R, Ctrl + G:
Removes unused using statements in a class and sorts them alphabeticallyCtrl + R, Ctrl + M
: Creates a method from the selected codeCtrl + X:
Cut line (empty selection)Ctrl + /
: Toggle line commentCtrl + Home
: Go to beginning of file
3. Shortcuts for debugging and testing:
F5
: Starts the application in debug modeCtrl + F5
: Starts the application without debug modeShift + F5
: Stops the application when it's runningCtrl + Shift + F5
: Stops the application execution, rebuilds the project, and creates a new debugging sessionF9
: Places or removes a breakpointF10
: Skips the execution of code when debuggingF11
: Debugs source code line by lineShift + F11
: Steps out of the execution of the methodCtrl + R, Ctrl + A
: Starts unit test execution in debug modeCtrl + R, A
: Starts unit test execution without debug mode
4. The most common shortcuts for use in the IDE:
Ctrl + [ + S
: If we have a file open, this shortcut allows us to quickly select it in the Solution Explorer window.Ctrl + Alt + L
: Opens the Solution Explorer windowCtrl + Alt + O
: Opens the Output window.Ctrl + \, E
: Opens the Error List windowCtrl + \, Ctrl + M
: Opens the Team Explorer window.Ctrl + Alt + B
: Opens the Breakpoints window.F4
: Opens the Properties window.Alt + F6
: Allows you to scroll back between windows on the panels that are open.Shift + Alt + F6
: Allows you to scroll forward between windows on the panels that are open.Shift + Esc
: Allows you to close the current tool windowCtrl + Alt + Pg Up
: Allows scrolling up between open documents even when it is not the same session.Ctrl + Alt + Pg Dn
: Allows scrolling down between open documents even when it is not the same session.Ctrl + Tab
: Displays a special window with the open documents and selects the most recent one.Ctrl + Shift + Tab
: Displays a special window with the open documents and selects the least recent one.Shift + Alt + Enter
: Allows you to place the Visual Studio environment at full screen, allowing you to concentrate on the current document. Use the same shortcut to get out of full-screen modeCtrl + K + K
: Creates a bookmark in the line where we are positioned. If there is already a bookmark on that line, it will be deleted.Ctrl + K + N
: Allows you to scroll forward through the different bookmarks that are part of a project.Ctrl + K + P
: Allows you to scroll backward through the different bookmarks that are part of a project.Ctrl + Shift + P, F1
: Show Command PaletteCtrl + P
: Quick Open, Go to File…Ctrl + Shift + N
: New window/instanceCtrl + Shift + W
: Close window/instanceCtrl + ,
: User SettingsCtrl +
: Show integrated terminalCtrl + Shift +
: Create a new terminal
5. Shortcuts for file management:
Ctrl + N
: Create a new fileCtrl + O
: Open a fileCtrl + S
: Save a fileCtrl + Shift + S
: Save all open filesCtrl + P
: Open the Quick Open dialog to quickly search and open a fileCtrl + Tab
: Switch between open filesCtrl + W
: Close the current fileCtrl + Shift + T
: Reopen the last closed fileCtrl + Shift + N
: Create a new folderCtrl + Shift + E
: Show/hide the Explorer panel, which displays the file and folder structure of your projectCtrl+ K Enter
: Keep preview mode editor open
Summary
This article has provided a comprehensive list of 100 essential shortcuts that every VS Code user should know. These shortcuts cover various areas such as file management, editing code, navigating the editor, and accessing VS Code features. By incorporating these shortcuts into your daily routine, you can save time and effort, reduce errors, and become more productive. With continued practice and familiarity with these shortcuts, you can elevate your coding skills to new heights and take full advantage of what VS Code has to offer.
Happy Coding!
Feel free to message me on my Social accounts for any help.