


The following vscode column will share with you some super invincible and practical vscode shortcut keys. Familiarity with vscode shortcut keys can improve efficiency. I hope it will be helpful to friends in need!
VS Code is a very popular editor in the programming field. Whether I am writing Vue, Python, Java, or MarkDown, I will use it for editing. Of course , and will also use its Vim plug-in. When writing code, it is often used to format the code. Although many operations can be performed through buttons on the menu, if you want to improve efficiency, you still need to remember its shortcut keys. [Recommended study: "vscode introductory tutorial"]
Here are 15 shortcut keys that I often use, which can greatly improve your editing efficiency, as follows:
0. Start VS Code from the command line
First install the code command in VS Code, start VS Code, press the shortcut key Command Shift p (Mac, if it is Win or Linus, it is Ctrl Shift p), and enter shell Select this installation code command, as shown in the figure below:
Then, if you want to use VS Code to open the current directory, you can execute it in the terminal:
code .
When This is useful when you are using the terminal and want to open a directory in VS Code. You can also code {path}
to open the corresponding path.
1. Search for the file and open it.
Shortcut keys:
- Mac: Command p
- Windows/Linux: Ctrl p
Between files Navigation is a very common requirement. While editing one file, another file needs to be modified simultaneously. At this time, the most efficient way is to type the file name to perform a fuzzy search and then press Enter to open it. Press this shortcut key and then enter the file name and press Enter. Opening the corresponding file is much faster than selecting it with the mouse.
2. Select all matches at once and modify them at once
Shortcut key:
- Mac: Command shift l
- Windows/Linux: Ctrl shift l
First select or search for the content that needs to be modified, and then press the shortcut key, all matching content will be Selecting and then modifying it is equivalent to modifying all matching content. There is no need to copy and search and replace first. What you see is what you get, which is very convenient.
3. Select the matched ones one by one and modify them all at once
Shortcut key:
- Mac: Command d
- Windows/Linux: Ctrl d
First select or search for the content that needs to be modified, then press this shortcut key, the first matching content will be selected, and then Press once and the next matching content will be added until the content you need to modify is selected, and then modifying it is equivalent to modifying all the selected content. Compared with the previous content, you can freely choose what you want. The matching content range.
4. Undoing the previous selected match is the reverse operation of shortcut key 3
Shortcut key:
- Mac: Command u
- Windows/Linux: Ctrl u
When you select multiple matching contents, you can press this shortcut key to cancel the selection, yes The reverse operation of shortcut key 3.
5. Select the entire line
Shortcut key:
- Mac: Command l
- Windows/Linux: Ctrl l
This is very similar to Vim's Visual mode. Press v and then j to select a whole line of text.
Press this shortcut key to select the entire content of the line where the cursor is located, and press it again to append the next line.
6. Jump to the specified line
Shortcut key:
- Mac: Ctrl g
- Windows/Linux: Ctrl g
This shortcut key conflicts with the Vim plug-in. After all, it is too simple for Vim to jump to a specified line: in command mode, just colon and line number can jump. .
Press this shortcut key, enter the line number and press Enter to jump to the corresponding line number.
7. Close all open tabs
Shortcut keys:
- Mac: Command k w
- Windows/Linux: Ctrl k w
If you open too many files, a lot of tab pages will be generated just like a browser. If you want to close them all, just press this shortcut key, and then the entire editor will be refreshed.
#8. Block comments.
Shortcut keys:
- Mac: Shift Option a
- Windows: Shift Alt a
- Linux: Ctrl Shift a
This is very simple, just select a piece of code and press the shortcut key to comment out the code as a block comment.
9. Fold/expand code.
Collapse shortcut key (left bracket):
- Mac: Command Option [
- Windows/Linux: Ctrl Shift [
Expand shortcut keys (left bracket):
- Mac: Command Option ]
- Windows/Linux: Ctrl Shift ]
10. Move rows
Shortcut keys
- Mac: Option up/down
- Windows/Linux: Alt up/down
11. Open the terminal
Shortcut keys
- Mac: Ctrl `
- Windows/Linux: Ctrl `
12. Split window
Shortcut keys
- Mac: Command \
- Windows/Linux: Ctrl \
The split window can compare files or different locations of the same file, which is very convenient for programming.
13. Formatting documents
Shortcut keys
- Mac: Shift Option f
- Windows: Shift Alt f
- Linux: Ctrl Shift i
Usually we enable extensions or configuration settings to format documents on save, but sometimes we like to control when we want to Format the document. That's where this command comes in. It allows us to format the current document according to the configured settings.
14. Copy the selected content to the bottom or above
Shortcut keys
- Mac: Option Shift up/down
- Windows/Linux: Shift Alt up/down
Use this command to copy the selected code above or below the current code. For example, when the functions of two functions are almost the same, you can use it to quickly copy it below, and then make some modifications to turn it into a new function.
15. Open or hide the sidebar
Shortcut keys
- Mac: Command b
- Windows/Linux:
You can use this command to switch the sidebar so that you have more screen space when looking at the code.
Finally
This article introduces 15 common and efficient VS Code shortcut keys, which can greatly improve your coding efficiency. Of course, there are other useful shortcuts, such as Command Shift f (Mac) to search the contents of a file, Command Shift p to search for commands, command / to toggle line comments, and more.
Thanks for reading. I’m here to ask for attention again. If you think the content is good, please follow it or share it with your friends. Thank you for your support.
For more related knowledge about VSCode, please visit: vscode tutorial! !
The above is the detailed content of Summary and sharing of 15 super practical vscode shortcut keys (quick collection). For more information, please follow other related articles on the PHP Chinese website!

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

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

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

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

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

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


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

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version
