Home > Development Tools > VSCode > body text

Several VSCode code tips and tricks worth collecting [animation demonstration]

青灯夜游
Release: 2022-08-09 20:20:55
forward
3325 people have browsed it

This article summarizes and shares with you some VSCode code tips and tricks worth collecting. Hurry and save them, maybe you will use them often in the future!

Several VSCode code tips and tricks worth collecting [animation demonstration]

[Recommended learning: "vscode introductory tutorial"]

Code folding

Keyboard shortcuts: Ctrl Shift [ and Ctrl Shift ]

Several VSCode code tips and tricks worth collecting [animation demonstration]

Trim trailing spaces

Keyboard shortcuts: Ctrl K Ctrl The actual operation is Ctrl K, then Ctrl X.

Currently Ctrl K key is basically defined as an operation related to files, while Ctrl K Ctrl key is mostly an operation related to layout etc.Several VSCode code tips and tricks worth collecting [animation demonstration]

Code formatting

Currently selected source code: Ctrl K Ctrl F Entire document format: Shift Alt F

Move rows up and downSeveral VSCode code tips and tricks worth collecting [animation demonstration]

Keyboard shortcuts: Alt Up or Alt Down

Multiple cursor selection Several VSCode code tips and tricks worth collecting [animation demonstration]

Keyboard shortcuts: Ctrl Alt up key or Ctrl Alt down key

This feels very convenient

You can use Ctrl Shift L to add an additional cursor to all instances of the current selection Several VSCode code tips and tricks worth collecting [animation demonstration]

If you don't want to add all currently selected items, you can use Ctrl D instead. This will only select the next event after the event you selected, so you can add selections one by one.

Several VSCode code tips and tricks worth collecting [animation demonstration]

Copy lines up/downSeveral VSCode code tips and tricks worth collecting [animation demonstration]

Keyboard shortcuts: Shift Alt Up Arrow or Shift Alt Down key

When multiple cursors are selected, only the value of the first row will be copied

Several VSCode code tips and tricks worth collecting [animation demonstration]

Column (Box) Selection

You can select blocks of text by holding down Shift Alt (Shift Option on macOS) while dragging the mouse. A separate cursor will be added to the end of each line.

Several VSCode code tips and tricks worth collecting [animation demonstration]pee

)Peek

Select a symbol and enter Alt F12. Alternatively, you can use the context menu.

Go to definition: Select a symbol and type F12

Go to reference: Select a symbol and type Shift F12

Several VSCode code tips and tricks worth collecting [animation demonstration]

Attached is the official document


https://code.visualstudio.com/docs/getstarted/tips-and-tricks#_preventing-dirty-writes

If it helps you, I can Like?

For more knowledge about VSCode, please visit:

vscode tutorial
!

The above is the detailed content of Several VSCode code tips and tricks worth collecting [animation demonstration]. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template