search
HomeDevelopment ToolsVSCodeSeveral VSCode code tips and tricks worth collecting [animation demonstration]

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!

Statement
This article is reproduced at:csdn. If there is any infringement, please contact admin@php.cn delete
手把手带你会习VSCode debug,不信你还不会!手把手带你会习VSCode debug,不信你还不会!Mar 31, 2022 pm 08:45 PM

2022年了,该学会用VSCode debug了!下面本篇文章手把手带大家会习VSCode debug,希望对大家有所帮助!

浅析VSCode怎么关闭自动更新浅析VSCode怎么关闭自动更新Jun 02, 2022 pm 12:56 PM

VSCode怎么关闭自动更新?下面本篇文章给大家介绍一下VSCode关闭自动更新的方法,希望对大家有所帮助!

手把手带你在VSCode中配置 Geant4 和 Root手把手带你在VSCode中配置 Geant4 和 RootApr 25, 2022 pm 08:57 PM

本篇是VSCode配置文章,手把手教大家怎么在VSCode​中配置使用 Geant4 和 Root,希望对大家有所帮助!

扒一扒vscode Prettier选项中的16个实用属性,让代码变美!扒一扒vscode Prettier选项中的16个实用属性,让代码变美!May 03, 2022 am 10:00 AM

本篇文章扒拉一下vscode Prettier的选项,总结分享16个让你的代码变漂亮的属性,希望对大家有所帮助!

23个提高开发效率的前端VSCode插件(快来收藏)23个提高开发效率的前端VSCode插件(快来收藏)Jul 25, 2022 pm 08:06 PM

本篇文章给大家分享23个前端VSCode插件,助你提高开发效率,让你事半功倍,快来收藏吧!

总结分享12个好玩有趣的 VSCODE 插件总结分享12个好玩有趣的 VSCODE 插件May 27, 2022 am 11:06 AM

“工欲善其事,必先利其器!”,vscode作为前端开发的重要工具,其插件能大幅提升战斗力,精心收集12个插件,总有几款你还未曾拥有。

VSCode中如何开发uni-app?(教程分享)VSCode中如何开发uni-app?(教程分享)May 13, 2022 pm 08:11 PM

VSCode中如何开发uni-app?下面本篇文章给大家分享一下VSCode中开发uni-app的教程,这可能是最好、最详细的教程了。快来看看!

手把手教你在VScode中配置C/C++环境(Win下)手把手教你在VScode中配置C/C++环境(Win下)Oct 10, 2022 pm 06:52 PM

VScode中怎么开发置C/C++?怎么配置C/C++环境?下面本篇文章给大家分享一下Windows系统下VScode配置C/C++环境图文教程,希望对大家有所帮助!

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use