Wechat can search the public number “back-end technology school” reply “1024” to get 50 computer e-books, reply “into the group” pull you into the reader technology exchange group, the article continues to update every week!
This article launches personal wechat official account, click to read the original article
Hello, I’m lemon. Let’s get right to today’s topic.
See also VsCode
Visual Studio Code (VS Code for short) is a free Code editor developed by Microsoft that supports Windows, Linux, and macOS operating systems. In the 2019 Stack Overflow developer Survey, VS Code is considered the most popular development environment for developers.
VsCode remote development environment compared to other IDE remote development environment, the implementation of the real remote development, on the local host (usually Windows or MAC) object is the remote machine (Linux). All modifications on the local host are directly based on remote files, getting rid of the traditional development process of local editing files, using FTP tools uploaded to the remote compiler debugging compilation, this set of tedious operations, so it is very convenient.
This article has been republished 15 times. It is a handy guide to how to configure VS Code remote development tools to increase your productivity by a factor of N.
I will combined with your daily work experience, this article will teach you to create a smooth experience of C/C + + development environment, this configuration guide may not be comprehensive, nor detailed step by step, teach you how to configure the plug-in, these too detail work is left to you to complete, actually plug-in download page will have detailed instructions.
Many novices may feel that VsCode editing text is ok, look at the code and write code is too difficult to use, that is not to master the correct way to open,VsCode is the essence of the rich plug-in system support, I believe that after reading this article to configure the environment, only one sentence “really sweet” can describe.
To give an intuitive impression, let’s take a look at my list of VsCode plug-ins. Since I use VsCode to develop C/C++/Go/Python programs, there are a lot of plug-ins, and some of them may not be relevant to this article can be ignored.
Basic development plug-in
Since it is configured to support the development of C/C++ environment, the first recommended basic C/C++ development plug-ins, the following two are required to install plug-ins, mainly provide some basic code debugging and viewing functions. When installed, VsCode supports intelligent code completion, type filling and association, symbol and function definition jump, reference lookup, and other essential C/C++ program development and source management capabilities, making your VsCode evolve from an editor into a basic IDE plug-in.
The source code to read
One is to write your own code, and the other is to read other people’s code. Here are two plug-ins that let you look at code elegantly in VsCode.
TODO Tree, TODO Tree, TODO Tree, TODO Tree
This plugin is used when you look at the code and add the following comment:// TODO will extend this functionality in the future
Of course, you don’t know when this “later” will be, and it will become a long way off, partly because you don’t want to change it, and partly because the person who wrote the comment will forget it over time. In this case, you need the “TODO Tree plugin”, which makes it easier to manage such comments in your code.
This plugin helps you organize and manage TODO comments. The TODO tags you annotate in your code will be displayed in the sidebar, not limited to TODO comments, but can be customized to manage tags such as FIXME, filter and filter based on tags.
Another recommended source reader plug-in is Bookmarks
Bookmarks is as straightforward as its name suggests. It’s a bookmark for your source code. When you’re looking at big project source code, you’ll need to jump through thousands of source files, and Bookmarks will make it easy to create and manage BookmarksCtrl + Alt + K
, click more than once is deleted, not only that he also provides in the bookmark before jumping and view management functions, more functions can experience themselves, anyway I see big project source code with this very cool.
Code management
Git is the most widely used version control tool in the project. Of course, VsCode itself provides rich Git version control functions. You can basically complete some Git operations by clicking on the interface. But the two plug-ins I’m going to introduce today can make your Git more amazing, which is the enhancement of the function, so that your Git operation is more intuitive and easy to use, who doesn’t like beautiful things?
First up is the Git Graph, which visualizes your Git repository, makes your commit records look nice, and provides rich Git operations based on the points in the Graph.
Like what you see, submit the record into one time line, the branch can clearly distinguish the time line with different colors, and clicked on submit online submission point to view the submit action, what changes have been made can see on the submit action, can also be easy to jump to change files, more experience by oneself, Lemon strongly recommends this plugin!
The GitLens plug-in described below is also a Git enhancement tool.
One of my favorite features is that it displays the submission information of the change directly after the location of the change in the file, and then you can jump directly to the submitted file for comparison. There are plenty of other features, but this one is the one I use most.
Small but beautiful tools
The following plug-ins are tools that I have accumulated in daily use. They are not necessary, but with the happiness of coding, they will be introduced to you one by one.
The first one is the Bracket Pair Colorizer plugin. I call it the Bracket Bracket plugin.
Are you constantly frustrated that curly braces, curly braces, and curly braces don’t match? Are you often blinded by matching brackets? Now don’t worry about 888 or 998, just download and install this plugin with one click and don’t worry about it anymore. This plugin allows every parenthesis you write to find its own color, in pairs. Click on one half of the parentheses to automatically match the other half, saving programmers from myopia.
Consider the koroFileHeader plug-in, which is used to automatically insert headers and function descriptions.
For example, we often see header files that start with templates like this:
/****************************************************************************** * FILENAME: Niu_bi_head_file. H * DESCRIPTION: very cool header * HISTORY: Date Author Comment * 2020/09/05 lemon *******************************************************************************/
Copy the code
After installing the plugin, you simply need to configure the desired format and press Ctrl + Alt + I to automatically generate such a template.
Similar function description annotation template, just press the shortcut key Ctrl + Alt + T can be completed, very convenient.
Switcher can switch between header files and C/C++ files.
This plugin is simply because I’m too lazy to save Labour, to find an auxiliary tool, we often need to pass a header file to the corresponding source file, or to jump to the corresponding header file from the source file, of course can choose in the sidebar file manager to open, but have one more step a bit tedious, so I took this plug-in, actually in the plug-in documentation, It is able to jump between different file types, not just header files and source files, lazy people Gospel, you deserve it.
utility
The following plugins are useful tool plugins, each for your needs.
The first one is the official VsCode Chinese package. Lemon advocates and encourages people to use more practical English, but if you don’t want to bother, then our Chinese is profound and beautiful, so let VsCode also speak Chinese, Microsoft official direct supply, good compatibility, rest assured to eat.
The Markdown preview enhancement plugin is shown below. Markdown is a must-have for anyone who blogs or posts regularly, with split-screen preview support and a variety of rich Markdwon enhancements.
Finally, the Shellman plugin is a Linux shell scripting aid. Working in Linux, it is hard to avoid writing a script. This plug-in can provide convenient shell script automatic completion and association functions, improve your script writing speed and accuracy.
The most commonly used shortcut keys
There are so many shortcut keys that it is not necessary to write them down completely. Just memorize some frequently used ones and some rarely used ones to strengthen your memory when you use them. List my own common shortcuts, not many, but enough! More than enough for day-to-day development.
Ctrl + Shift + P must come first, this command is the “mother of all commands”. This is not too much to say, it opens the VsCode command window, where you can type the name of the plug-in mentioned above to see what features the plug-in supports, along with a description of feature shortcuts.
So let’s do an example. Let’s typeCtrl + Shift + P
Open the command to find the input box, and then typebookmarks
You will know all the features supported by the plugin, and note the shortcut keys.
Ctrl + P file lookup. Quickly open the file list, enter the keyword to match the file, preferentially display the latest opened file, convenient to jump between specified files.
F12 jumps to the definition, there’s nothing to say about that, jumps to the definition of a function or a sign, that’s a high frequency operation.
Alt + F12
Display the definition in preview mode on the current page, both to view the definition, relativeF12
The advantage is that it does not jump out of the current file into the definition file, but opens a small window preview of the current file, as shown below:
Shift + F12
View the reference to the function or variable where the cursor is, as inAlt +F12
Open a list of referenced files in the current file as a preview. The diagram below:
Alt + left/right arrow to move forward or backward to the source above the cursor.
Ctrl + Shift + O to view the symbols of the current file. You can filter symbols by keyword. Of course, you can also look for symbols in the outline view on the left, but the outline view does not find matching symbols, so I prefer to use shortcut keys to find symbols.
Are we done with keyboard shortcuts? No, too many shortcuts; Aren’t the other shortcuts important? It varies from person to person. The shortcut keys used in high frequency are important, and the ones I mentioned above are used in ultra high frequency. It is almost enough to remember them, and the rest of them will be remembered naturally if you use them more. Enjoy VsCode Coding as soon as possible!
A few last words
When I was a freshman in college, I had to install VC++ 6.0 for the C language course. At that time, there were also ides like Visual studio, but the teacher didn’t recommend other ides. It was because of my interest in programming that I found more ‘modern’ ides than VC++ 6.0. Jetbrain and Visual Studio, for example, can’t stop experimenting.
Now the mainstream IDE has been very rich, in fact, editor or IDE is just a tool, there is no best use of their own handy, just like the Vim party and Emacs party who can not convince anyone, some people like.
It’s more important to focus on programming itself. Improving your hard skills is the most important thing, but good tools can get you more done with less. Lemon is all for that, and I hope this article will help you get more done with less.
My name is lemon. I love technology, and I love life. I insist on sharing output, so that both myself and readers can benefit from it! Focus on me and get stronger with me.
If the article is helpful to you, please do not hesitate to “like, comment, forward” to encourage me to continue to create.
Wechat can search the public number “back-end technology school” reply “1024” to get 50 computer e-books, reply “into the group” pull you into the reader technology exchange group, the article continues to update every week!