Development Tools
VSCode
(Animation demonstration) How to write code efficiently in VSCode? Tips sharing(Animation demonstration) How to write code efficiently in VSCode? Tips sharing
This article uses animations to show you how to write code efficiently in VSCode. I hope it will be helpful to friends in need!

[Recommended study: "vscode introductory tutorial"]
Demonstrate how to write code efficiently
Some codes have been written repeatedly. Do I still need to write them again?
The answer is no , because as long as cv is enough, is there any method that is more elegant, efficient, and faster than cv? yú) skills?
The answer is yes, that is my own Quick Thirteen Whips
Here is a demonstration of how I wrote before I started the architecture高(mō)frequency(yú)Business code:
I want to trigger a click event and create a submitted function. In business, this submitted function appears very
highlyUse some common function libraries in this function, then go back to the head and write the header file (the package that imports the function), and then come back to this function to continue writing the unfinished logic.

The first whip: master the shortcut key customization
The first whip is especially important, because he is the entire shortcut The most basic knowledge of keys is the most important axis bone. If you don’t understand after reading it once, then read it again
Master the customization of shortcut keys, which can enrich your operating habits and avoid Shortcut key conflict, Keep the operating habits of each shortcut.
Because the shortcut keys of visual studio code are fast portable, you don’t have to worry about setting the shortcut keys again and again after changing computers or systems
Open the shortcut Panel
Press cmd k cmd s to quickly open the shortcut panel
or call out the control panel (ctrl shift p) Enter Keyboard | keyboardFind
Get to know the default keyboard shortcuts (JSON)
Why you need to know the default keyboard shortcuts key?
Because it’s easy to use, you know the unmodified keyboard mapping and the default keyboard shortcut keys 
It looks like this, it is a JSON file

Open the keybindings.json file of shortcut keys

Open the json file that stores user shortcuts according to the animationkeybindings.json , as long as the shortcut key is modified, it will have the following format
{
"key": "cmd+k cmd+s",
"command": "workbench.action.openGlobalKeybindings"
"when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
}This file is a user-defined JSON file, which is a mapping format
-
keyShortcut keys -
commandShortcut key commands for vscode -
whenConditions for the command to take effect
The keybindings.json file is a json file. The shortcut keys you have modified are stored here. When changing machines, you can copy the contents of this file to another machine, which is very nice~~
After all, this is what I do

Customized shortcut keys
Commands that only require shortcut keyscommand or default shortcut key or directly enter the Chinese fuzzy word of the shortcut key to query the mapping of the shortcut key and modify the shortcut key
For the shortcut keys used in the article, the author will provide code snippets in the following format for easy query
{
"key": "cmd+k cmd+a",
"command": "workbench.action.openDefaultKeybindingsFile"
}[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image. Upload directly (img-qo5Z56PF-1621655509407)(https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/a7b054961f614a63aee6f7dda082ec05~tplv-k3u1fbpfcp-watermark.image)]
第二鞭:定位篇
定位是快速写代码的核心操作,因为这个是日常编码高频率操作,高达90%以上,必须全部掌握下来,很实用 。
定位设计到代码块的精准定位,定位到类的定义、定位到应用、实现、快速查看、上一次之前的历史修改、设置某处的标签,然后快速找(vim直呼内行)到等等。
定位行
{
"key": "ctrl+g",
"command": "workbench.action.gotoLine"
},场景示例:在浏览器找到你的文件在100行报错,找到原因后,定位在100行去修改代码

更多关于VSCode的相关知识,请访问:vscode教程!!
The above is the detailed content of (Animation demonstration) How to write code efficiently in VSCode? Tips sharing. For more information, please follow other related articles on the PHP Chinese website!
Is Visual Studio Still Free? Understanding the AvailabilityApr 18, 2025 am 12:05 AMYes, some versions of VisualStudio are free. Specifically, VisualStudioCommunityEdition is free for individual developers, open source projects, academic research, and small organizations. However, there are also paid versions such as VisualStudioProfessional and Enterprise, suitable for large teams and enterprises, providing additional features.
Using Visual Studio: Developing Software Across PlatformsApr 17, 2025 am 12:13 AMCross-platform development with VisualStudio is feasible, and by supporting frameworks like .NETCore and Xamarin, developers can write code at once and run on multiple operating systems. 1) Create .NETCore projects and use their cross-platform capabilities, 2) Use Xamarin for mobile application development, 3) Use asynchronous programming and code reuse to optimize performance to ensure efficient operation and maintainability of applications.
How to format json with vscodeApr 16, 2025 am 07:54 AMThe ways to format JSON in VS Code are: 1. Use shortcut keys (Windows/Linux: Ctrl Shift I; macOS: Cmd Shift I); 2. Go through the menu ("Edit" > "Format Document"); 3. Install JSON formatter extensions (such as Prettier); 4. Format manually (use shortcut keys to indent/extract blocks or add braces and semicolons); 5. Use external tools (such as JSONLint and JSON Formatter).
How to compile vscodeApr 16, 2025 am 07:51 AMCompiling code in VSCode is divided into 5 steps: Install the C extension; create the "main.cpp" file in the project folder; configure the compiler (such as MinGW); compile the code with the shortcut key ("Ctrl Shift B") or the "Build" button; run the compiled program with the shortcut key ("F5") or the "Run" button.
How to install vscodeApr 16, 2025 am 07:48 AMTo install Visual Studio Code, please follow the following steps: Visit the official website https://code.visualstudio.com/; download the installer according to the operating system; run the installer; accept the license agreement and select the installation path; VSCode will start automatically after the installation is completed.
How to enlarge fonts with vscodeApr 16, 2025 am 07:45 AMThe methods to enlarge fonts in Visual Studio Code are: open the settings panel (Ctrl, or Cmd,). Search and adjust "Font Size". Choose "Font Family" with the right size. Install or select a theme that provides the right size. Use keyboard shortcuts (Ctrl or Cmd) to enlarge the font.
How to connect to a remote server with vscodeApr 16, 2025 am 07:42 AMHow to connect to a remote server through VSCode? Install Remote - SSH Extended Configuration SSH Create a Connection in VSCode Enter connection information: Host, Username, Port, SSH Key Double-click the saved connection in Remote Explorer
How to run vue with vscodeApr 16, 2025 am 07:39 AMRunning a Vue project in VSCode requires the following steps: 1. Install the Vue CLI; 2. Create a Vue project; 3. Switch to the project directory; 4. Install project dependencies; 5. Run the development server; 6. Open the browser to visit http://localhost:8080.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

Atom editor mac version download
The most popular open source editor

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Mac version
God-level code editing software (SublimeText3)







