Commonly used toolbar options for vscode development, source code viewing techniques, and [commonly used shortcut keys for vscode]


1. Develop commonly used toolbar options

1. The currently opened file can be quickly located in the resource tree on the left:

  • In fact, when you open the current file, the resource tree is already located on the left, but the color is lighter.


2. When too many files are open, you can close them.


3. Set to view the structure of the current class or file OUTLINE

  • Equivalent to idea, view the structure of the current class or interface Structure


2. View source code tips:

(1) Ctr+mouse

  • Click on the target to enter, click again, if you can't enter again, it will come out. The target can be an attribute object, a class, an interface, a method, and so on.

(2) Alt+arrow direction←

  • Returns the cursor to the previous cursor position. Sometimes, because you want to return to the previous cursor position without moving the cursor position after Ctr + mouse click, then Alt + ←

(3) Search shortcut keys

  • Search in the current file: ctr+f
  • Global search: ctr+shift+f
  • Command line search: ctr+p

(4) Print log observation




3. Commonly used shortcut keys in vscode

Comment code: select the code, Ctr+/

Format code (whole file): shift + alt +f

Format selected code: ctr+k ctr+f

☺Find files: ctrl + p

☺Find files globally: ctrl + shift + f

☺View all the places where the variable/method name is used in the document: ctr+mouse click

☺Universal key [open command panel]: Ctrl+Shift+P

To select a variable/method name: double-click the mouse

★ Insert a line below the current line: Ctrl+Enter



☺ Batch operation shortcut keys

Manual selection range, vertical batch modification: alt+shilf

Starting from the current position, select the end position down, and modify the target: ctr+ b

  • Replace a word: 先双击选定一个单词, and then press ctrl + dto select the same word in sequence. This makes it very convenient to modify the same words at the same time.

Modify all targets of the current document: ctr+f2

  • Batch replace all matching text in the current file: Ctrl + F2



— Others are some common shortcut keys —




If this article is helpful to you, please remember to give Yile a like, thank you!

Guess you like

Origin blog.csdn.net/weixin_45630258/article/details/130181882