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:
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.
Shortcut keys:
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.
Shortcut key:
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.
Shortcut key:
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.
Shortcut key:
When you select multiple matching contents, you can press this shortcut key to cancel the selection, yes The reverse operation of shortcut key 3.
Shortcut key:
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.
Shortcut key:
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.
Shortcut keys:
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.
Shortcut keys:
This is very simple, just select a piece of code and press the shortcut key to comment out the code as a block comment.
Collapse shortcut key (left bracket):
Expand shortcut keys (left bracket):
Shortcut keys
Shortcut keys
Shortcut keys
The split window can compare files or different locations of the same file, which is very convenient for programming.
Shortcut keys
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.
Shortcut keys
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.
Shortcut keys
You can use this command to switch the sidebar so that you have more screen space when looking at the code.
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!