The main command box
F1 or Ctrl+Shift+P: Opens the command panel. In the open input box, you can enter any command, as shown in the picture below (if the picture is too large to view clearly, you can right click “Open picture in New TAB” to view the original picture, the same below) :
Such as:
Press the Backspace key to go to Ctrl+P mode. Press Ctrl+P and type > to go to Ctrl+Shift+P mode. In the Ctrl+P window, you can also directly enter the file name to jump to the fileCopy the code
Enter “? “in Ctrl+P mode. A drop-down menu will pop up, as shown below:
Common ones are as follows:
? Lists the current actions that can be performedCopy the code
! Displays Errors or Warnings, or Ctrl+Shift+MCopy the code
: Jumps to the number of lines, or Ctrl+G to enter directlyCopy the code
Jump to symbol (search variable or function) or Ctrl+Shift+OCopy the code
Find symbol by name (Ctrl+TCopy the code
Two, common shortcut keys
1. Editor and window management
New File: Ctrl+N To switch between files: Ctrl+Tab to open a new VS Code editor: Ctrl+Shift+N to close the current window: Ctrl+W to close the current VS Code editor: Ctrl+Shift+W Cuts out a new editor window (split screen - up to 3): Ctrl+\ Toggle 3 editor Windows left, middle and right shortcut keys: Ctrl+1 Ctrl+2 Ctrl+3Copy the code
2. Code editing
(1) Format adjustment ****
Indent line left or right: Ctrl+[, Ctrl+] Copy or cut current line/selected content: Ctrl+C, Ctrl+V Format code: Shift+Alt+F Move a line Up or Down: Alt+Up or Alt+Down Copy a line Up or Down: Shift+Alt+Up or Shift+Alt+Down Inserts a line below the current line: Ctrl+Enter Inserts a line above the current line: Ctrl+Shift+EnterCopy the code
(2) Cursor correlation
Move to top of line: Home move to End of line: End Move to End of file: Ctrl+End Move to top of file: Ctrl+Home Move to definition: F12 View thumbnail image at definition (just look at it without skipping to it): Alt+F12 Select content from cursor to End of line: Shift+End Selects everything from the cursor to the beginning of the line: Shift+Home Deletes everything to the Right of the cursor (current line): Ctrl+Delete Extends/shrinks the selection: Shift+Alt+Right and Shift+Alt+Left Multi-line editing (column editing): Alt+Shift+ left mouse button or Ctrl+Alt+Down/Up Select all matches at the same time edit (match current line or selected content): Ctrl+Shift+L The next match is also selected: Ctrl+D Rewind previous cursor action: Ctrl+U Undo previous action: Ctrl+Z Manual save: Ctrl+SCopy the code
(3) Refactor the code
Find all references: Shift+F12 modify all matches in this file at the same time: Ctrl+F2 jump to the next Error or Warning: When there are multiple errors, press F8 to jump to one by oneCopy the code
(4) Find replacements
Find: Ctrl+F Find replace: Ctrl+HCopy the code
(5) Display correlation
Full screen display (press again to restore): F11 Zoom in or out (based on the top left corner of the editor): Ctrl+ /- Sidebar Show or hide: Ctrl+B Shows Explorer (only when the cursor is moved to the sidebar): Ctrl+Shift+E Shows search (only when the cursor is moved to the sidebar): Ctrl+Shift+F displays source control (only valid if the cursor is cut to the sidebar): Ctrl+Shift+G+G displays Debug: Ctrl+Shift+D Displays Output: Ctrl+Shift+UCopy the code
More references
Reference document: Visual Studio Code: Common shortcuts – Zhwen Studio
Visual Studio Code Key Bindings
Soup of the day:
The difficulties increase as the goal is approached. I hope everyone is like a star calmly and calmly along the established goals continue to complete their own journey. — Goethe