The cursor
- Move to the front of the word:
Option + please
- Move to the end of the word:
Option + -
- Move the current line of code to the previous line:
Option + write
- Move the current line of code to the next line:
Option + left
- Move to the front of the current line:
CMD + please
- Move to the end of the current line:
CMD + -
- Jump between curly braces:
cmd + shift + \
- Move to the first or last line of the document:
CMD + write
/CMD + left
The text choose
Word, line, and document cursor manipulation with shift to select text while moving the cursor; For example, select the current cursor position to the front of the current line: CMD + ← + Shift
Delete operation
- Deletes all characters after the current line cursor:
cmd + fn + delete
- Delete all characters before the current line cursor:
cmd + delete
- Deletes the character after the current word cursor:
option + fn + delete
- Delete the character before the current word cursor:
option + delete
Add comments
- Comment a line of code:
cmd + /
- Comment an entire section of code:
option + shift + A
Formatting code
- Formatting code:
option + shift + F
- Formatting selected lines of code:
cmd + K cmd + F
- Indent code:
cmd + shift + P
Quick jump between files, symbols, and code
control+ tab
(while holding), continue to presscontrol
The key, loosentab
Key: Open the current open file list, select the file to open, releasecontrol
You can open the corresponding filecmd + P
Open the list of recently opened files, and a search box appears at the top of the list. Search for the file name, press Enter (enter
), you can open the corresponding file in the current window; usecmd + enter
The file opens in a new editor windowcontrol + G
: Line jump, enter the corresponding number enter, you can jump to the current filecmd + P
(Enter the file name + : + line number) : jumps to the specified line number of the specified filecmd + shift + O
: Call up the current file symbol (function name, etc.), use the arrow key or search, enter, you can jump to the symbol you want; If you enter:, you can classify all symbols of the current filecmd + T
: Opens multiple files and searches for symbols in multiple filesF12
: Jumps to the function definitioncmd + F12
: Jumps to the implementation position of the function; Cmd + F12: Cmd + F12: Cmd + F12: Cmd + F12shift + F12
: Opens a preview of function references (place the cursor over the function or class, pressshift+F12
You can open a reference list and an inline editor.)
The mouse operation
- In vscode, click the left mouse button to move the cursor to the response position. Double-click the left mouse button: select the word under the current cursor. Three left mouse button: select the current line of code; Click the left mouse button four times to select the entire document
- Click the row number with the left mouse button to select the row. When selected, press again
shift
, the left mouse button again select line: you can select multiple lines of code - Hover prompt window: when the mouse moves over some files, it will display information related to the text under the mouse. If you place the mouse over a function, press
cmd
, you can see the implementation of the function in the hovering prompt window. - Jumps and links to code: If we hover over a function, an underscore appears below the function, and when we press the left mouse button, we jump to the definition of the function. CMD + left mouse button to go to functions and variables defined. When writing documents in non-programming languages like Markdown, you can also open hyperlinks by using CMD + left mouse button
Fold the code
cmd + option + ][
Modify the shortcut key entry
cmd + option + L
The terminal opens the current folder using VS Code
code .