【Visual Studio Code】Coding speed improvement tips

Briefly

I have used vscode for so long. Here I record my frequently used shortcut keys and tips.

Tips

insert image description here
This is the working interface of vscode.
It is worth mentioning that the lower line of the interface is for quick display information and quick operations. You can quickly understand the description information of the open file.

use extension

When using vscode, be sure to install the corresponding extension package.
The extension pack can change the language, change the theme, code hints, code style, etc.
The benefits are endless, and it can help you configure vscode quickly.

insert image description here

View shortcut keys

After CRTL+K CRTL + S : View the list of shortcut keys (the following letters are not case-sensitive)
in the list of shortcut keys:

  • View shortcut keys.

  • Modify the keys for shortcut operations.
    For example:
    Sometimes we open too many folders in the left column, and want to collapse all expanded folders at once. There are two ways:

    • Click the fold icon on the upper right side to collapse all expanded folders.
      insert image description here

    • Search for the " Explorer " keyword in the shortcut key list , and find the custom folding shortcut key for " Folding folders in Explorer" . Here I am CRTL+[ fast folding.
      insert image description here

Quickly switch projects

CRTL + R can display your recently opened file items.

quick search

  • CRTL + F : Press in the working area to quickly find and replace operations. The main sidebar needs to click the find icon on the left to find it. Default is case insensitive.
  • CRTL + P : Search for files by name.
  • After CRTL + P: number : Jump to the specified line for quick search.
  • CRTL + P followed by the @ sign : Quickly view the symbols (variables, functions, classes, etc.) defined in the file, and add the sign after @ to classify the symbols.
  • CRTL + T : Keyword search content in the workspace.
  • CRTL + G : Quickly read jump lines.

Display multiple screens in the main work area

CRTL + \ Copy a screen according to the current screen.
Or
CRTL+number keys : open a new screen or switch screens, (the number keys start with 1 as the index, for example, there is only one screen currently, CRTL + 2: open the second screen)
insert image description here

Collapse the contents of the file

CRTL + SHIFT + [ : Collapse the contents of the cursor module area.
CRTL + SHIFT + ] : Expand the content of the cursor module area.
CRTL + K after CRTL + O : file content collapsed
CRTL + K after CRTL + J : file content expanded
CRTL + K after CRTL + / : file block comment content collapsed

Quickly locate the top and bottom of the file

CRTL + Home : Go to the top of the file.
CRTL + End : locate the end of the file

element renaming

  • Select the element and double-click to re-enter.
  • After selecting the element, F2: re-enter the value to be changed and press ENTER. He will revise all references related to it.
    insert image description here

View element location, definition and details

The following shortcut keys need to be selected to take effect.
CRTL + space : Display the relevant description information of the element.
insert image description here
CRTL + Click (click) or F12 after selection : jump to the element definition position.
ALT + F12 : After selecting, press this key to quickly view the content of the element definition on the current page.
insert image description here
SHIFT + F12 : Display the element definition and all references.

insert image description here

content manipulation

ALT + click : Select multiple lines.
CRTL + L : Select this line.
ALT + Up and Down Arrows : Move the line up and down.
CRTL + ALT + up and down arrows : Select multiple lines at the same time for operation.
insert image description here

CRTL + SHIFT + L : Click an element, press the key to select all matching items of the element.
insert image description here
CRTL + D : Select the current item, if the current item is selected, select the next matching item.

other

CRTL + B : Show or hide the main sidebar.
CRTL + ` or CRTL + J : Show or hide the panel

epilogue

Don't forget cv.

Guess you like

Origin blog.csdn.net/qq_43231248/article/details/130262270