More efficient use of Visual Studio (2)

Source: Internet
Author: User

Did not expect the previous articleArticleThanks for your support. Continue ~

The default settings for many common shortcut keys are actually abbreviated, Which Is ms to help us remember. For example, commentCodeIsCTRL+E+CIf we know that it isCTRL+ Edit + comment code is not easy to remember? I will try my best to associate the shortcut key with the function in YY to help me remember it. In addition, many functions can be implemented by multiple shortcut keys in vs. I guess it is designed to prevent some shortcut keys from conflict. I generally only remember it, and I will talk about it again after conflict.

3. More efficient Editor

3.1 more effective editing (Supplement)

A. Comment on the Code:CTRL+E(Edit) +C(Comment ),CTRL+K+C(Comment ). Different file types may be opened. In the CS file type, the code of the selected row is commented out, and in CPP, the selected content is commented out.

Anti-annotation code:CTRL+E(Edit) +U(Uncomment ),CTRL+K+U(Uncomment)

B. Adjust the selected code format:CTRL+E(Edit) +F(Format ).

C. Adjust the code format of the entire document:CTRL+E(Edit) +D(Document Format ).

3.2 more efficient search:

A. incremental search ):CTRL+I(Incremental) (move to the next matchCTRL+I, Move to the previousShift+CTRL+I). Press and hold the shortcut key, and enter the string to be queried. Vs will be located immediately without thinking about it.CTRL+FThe validation process can be seen through the graph I cut. Generally, if I want to perform a simple search in the current document, I usually use this search. If I encounter some complicated search conditions, I can use the pop-up box to search.

B.CTRL+F(FIND): in Visual Studio 2012, this function is already very similar to increment search. You will find that it is used in vs2012 +.CTRL+FThe results are the same as those above. You can view the search results by entering the search results. However, unlike increment search, this search can specify more conditions, such as whether to match the case, whether to search for the entire word, whether to use a regular expression, and the search range.

C. Find in the file:CTRL+Shift+F, This can achieve the search function andCTRL+FThe only difference is that you can output the search results to the search results window, rather than display them one by one. This is suitable for searching for more matching items and then filtering them by the naked eye in the output result window.

4. More effective Navigation:

1. Quickly open Solution Explorer:CTRL+W(Windows) +S(Solution ),CTRL+ALT+L. When writing code to open another file in the project, you can use this quick open solution window to select a file.

2. Open the list of currently opened files:CTRL+ALT+Down. This is very useful, but this shortcut will flip the screen on many computers. To use this function, you can use custom shortcuts.

3. Quickly move the focus to the category list (this term is purely YY, as shown in the figure below, we will know what I mean ):CTRL+F2.

4. Internal file switching:CTRL+Tab. This is not only in Vs, but also in many software.

5. full screen:Shift+ALT+Enter. This feature allows you to enter the full-screen mode without interference.

5. More effective smart sensing

Intelligent Sensing is actually intelligent, but many times we want to force some prompts to look at these features. Many multi-functional languages may be too tired to describe, and you may not be able to understand the language, so I will draw a picture.

1. List members.CTRL+K+L(List member ),CTRL+J. We know what methods are automatically prompted by. vs when we need to access object methods, but sometimes we need to check if the. Operator already exists. I used to delete the vertex and click it again. I admit that I was stupid at the time. Later I knew this shortcut key and it would be much better.

2. List options (the description is not clear. For details, refer to the description below ).CTRL+.OrCTRL+Shift+F10. When we use some types referenced in our projectProgramWhen the set is not referenced in the namespace of the current file, or when we write a function that does not exist, the line of code prompts an error and has a small symbol in the lower left corner .. Some help will appear when we move the cursor near the symbol, which can automatically help us add references or generate functions. This shortcut prompt appears without moving the mouse.

Vi. Others

1. The task list window can be opened through view-> task list. Many people may not know this function, and I think it is quite useful. When writing code, I often encounter this situation. I am not sure about the requirements of some code or think there may be problems that need to be improved in the future. I will add the Note: // todo: reason. I believe many people will share the same habit. The function of this task list is to show how many todo items are in our current project. Of course, it is not limited to the word todo, but can be customized. I usually take a look at this list before commit to see if there is any change to it. You can also directly add some tasks. You can use them to understand them.

 

VII. Plug-ins

We recommend two plug-ins: C # outline and smart Paster.

1. C # outline

The default outline of Visual Studio is only at the function level. However, in many cases, it is convenient to scale down some loop conditions. So we have this plug-in. The effect is as follows:

Before outline->

After outline->

2. Smart Paster

This plug-in can paste text into comments, string strings, and stringbuilder. It is especially useful for pasting multiple lines of text.

8. Recommended Materials

1. Favorite Visual Studio keyboard shortcuts: a group of people on stackoverflow are discussing their favorite shortcut keys. You can check them and you may see some unexpected shortcut keys.

2. Visual Studio programmer rumor: This book introduces a lot of vs knowledge.

3. Check out the things that have never been used on the vs menu bar. You may find something useful to you.

Summary

These are just some of the most useful tips for me. I strongly recommend you read the materials I recommend to explore some features that are more suitable for your habits. Because if you do not know the existence of this function, you simply cannot find such a function.

Let me say a few more words. There is absolutely no need to memorize many shortcuts and install them, because not all the shortcuts are required by everyone. To a large extent, the use of some functions depends on your work habits. At the same time, I do not recommend you to remember some shortcut keys that you don't think you will use, which is meaningless and a waste of time. This is why I only list some shortcut keys that are helpful to my work efficiency, rather than listing all the shortcut keys in Visual Studio, because that makes no sense!

So I strongly recommend that you only remember what you think is useful.

P.s.: In the comments, it seems that many people are more interested in how to make GIF images than in the article itself (Sorry, Ah ~~), I useLicecap tool.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.