The cursor

  1. Move to the front of the word:Option + please
  2. Move to the end of the word:Option + -
  3. Move the current line of code to the previous line:Option + write
  4. Move the current line of code to the next line:Option + left
  5. Move to the front of the current line:CMD + please
  6. Move to the end of the current line:CMD + -
  7. Jump between curly braces:cmd + shift + \
  8. 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

  1. Deletes all characters after the current line cursor:cmd + fn + delete
  2. Delete all characters before the current line cursor:cmd + delete
  3. Deletes the character after the current word cursor:option + fn + delete
  4. Delete the character before the current word cursor:option + delete

Add comments

  1. Comment a line of code:cmd + /
  2. Comment an entire section of code:option + shift + A

Formatting code

  1. Formatting code:option + shift + F
  2. Formatting selected lines of code:cmd + K cmd + F
  3. Indent code:cmd + shift + P

Quick jump between files, symbols, and code

  1. control+ tab(while holding), continue to presscontrolThe key, loosentabKey: Open the current open file list, select the file to open, releasecontrolYou can open the corresponding file
  2. cmd + POpen 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 + enterThe file opens in a new editor window
  3. control + G: Line jump, enter the corresponding number enter, you can jump to the current file
  4. cmd + P(Enter the file name + : + line number) : jumps to the specified line number of the specified file
  5. cmd + 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 file
  6. cmd + T: Opens multiple files and searches for symbols in multiple files
  7. F12: Jumps to the function definition
  8. cmd + F12: Jumps to the implementation position of the function; Cmd + F12: Cmd + F12: Cmd + F12: Cmd + F12
  9. shift + F12: Opens a preview of function references (place the cursor over the function or class, pressshift+F12You can open a reference list and an inline editor.)

The mouse operation

  1. 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
  2. Click the row number with the left mouse button to select the row. When selected, press againshift, the left mouse button again select line: you can select multiple lines of code
  3. 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, presscmd, you can see the implementation of the function in the hovering prompt window.
  4. 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 .