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
Visual Studio Professional and Enterprise: Paid Versions and FeaturesVisual Studio Professional and Enterprise: Paid Versions and FeaturesMay 10, 2025 am 12:20 AM

The difference between VisualStudioProfessional and Enterprise is in the functionality and target user groups. The Professional version is suitable for professional developers and provides functions such as code analysis; the Enterprise version is for large teams and has added advanced tools such as test management.

Choosing Between Visual Studio and VS Code: The Right Tool for YouChoosing Between Visual Studio and VS Code: The Right Tool for YouMay 09, 2025 am 12:21 AM

VisualStudio is suitable for large projects, VSCode is suitable for projects of all sizes. 1. VisualStudio provides comprehensive IDE functions, supports multiple languages, integrated debugging and testing tools. 2.VSCode is a lightweight editor that supports multiple languages ​​through extension, has a simple interface and fast startup.

Visual Studio: A Powerful Tool for DevelopersVisual Studio: A Powerful Tool for DevelopersMay 08, 2025 am 12:19 AM

VisualStudio is a powerful IDE developed by Microsoft, supporting multiple programming languages ​​and platforms. Its core advantages include: 1. Intelligent code prompts and debugging functions, 2. Integrated development, debugging, testing and version control, 3. Extended functions through plug-ins, 4. Provide performance optimization and best practice tools to help developers improve efficiency and code quality.

Visual Studio vs. VS Code: Pricing, Licensing, and AvailabilityVisual Studio vs. VS Code: Pricing, Licensing, and AvailabilityMay 07, 2025 am 12:11 AM

The differences in pricing, licensing and availability of VisualStudio and VSCode are as follows: 1. Pricing: VSCode is completely free, while VisualStudio offers free community and paid enterprise versions. 2. License: VSCode uses a flexible MIT license, and the license of VisualStudio varies according to the version. 3. Usability: VSCode is supported across platforms, while VisualStudio performs best on Windows.

Visual Studio: From Code to ProductionVisual Studio: From Code to ProductionMay 06, 2025 am 12:10 AM

VisualStudio supports the entire process from code writing to production deployment. 1) Code writing: Provides intelligent code completion and reconstruction functions. 2) Debugging and testing: Integrate powerful debugging tools and unit testing framework. 3) Version control: seamlessly integrate with Git to simplify code management. 4) Deployment and Release: Supports multiple deployment options to simplify the application release process.

Visual Studio: A Look at the Licensing LandscapeVisual Studio: A Look at the Licensing LandscapeMay 05, 2025 am 12:17 AM

VisualStudio offers three license types: Community, Professional and Enterprise. The Community Edition is free, suitable for individual developers and small teams; the Professional Edition is annually subscribed, suitable for professional developers who need more functions; the Enterprise Edition is the highest price, suitable for large teams and enterprises. When selecting a license, project size, budget and teamwork needs should be considered.

The Ultimate Showdown: Visual Studio vs. VS CodeThe Ultimate Showdown: Visual Studio vs. VS CodeMay 04, 2025 am 12:01 AM

VisualStudio is suitable for large-scale project development, while VSCode is suitable for projects of all sizes. 1. VisualStudio provides comprehensive development tools, such as integrated debugger, version control and testing tools. 2.VSCode is known for its scalability, cross-platform and fast launch, and is suitable for fast editing and small project development.

Visual Studio vs. VS Code: Comparing the Two IDEsVisual Studio vs. VS Code: Comparing the Two IDEsMay 03, 2025 am 12:04 AM

VisualStudio is suitable for large projects and Windows development, while VSCode is suitable for cross-platform and small projects. 1. VisualStudio provides a full-featured IDE, supports .NET framework and powerful debugging tools. 2.VSCode is a lightweight editor that emphasizes flexibility and extensibility, and is suitable for various development scenarios.

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

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.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use