From http://www.cnblogs.com/rond/archive/2012/03/05/2380367.html
Fifteen Visual Studio skills to improve your development efficiency
I believe that developers do not pay less attention to efficiency. C # and VB developers all know that we rely heavily on vs, or we are very grateful to. The ability to create dependencies on an IDE indicates that this ide does have its uniqueness. Undoubtedly, VS is a very powerful ide that supports multi-language editing. Supports C #, VB, C/C ++, HTML ...... it has powerful debugging and compilation functions. It eliminates the need to remember the cumbersome processes of installation, environment variable settings, server settings, and compilation. Highly integrated. There are advantages and disadvantages in everything. In the era of agile development, there is no doubt whether vs is worth our use. However, powerful vs has many settings and many skills. Remember some tips that make it easier and quick to use. This is necessary. Everyone remembers some tips. But it is impossible to remember all of them. We should remember some of the things we commonly use according to our own programming habits.
The following are some tips that you may find frequently used during the coding process and hope to help you.
1. Edit rows (copy, cut, delete, switch)
When you stop at the cursor, use the shortcut keyCTRL + C, X, lYou can copy, cut, and delete the entire line of content. Of course, right-click is also acceptable. Normally, copying, cutting, and deleting are both selected and not selected.Code.
You can use the shortcut key (Shift + ALT + T), Provided that the cursor stays on the line above. After replacement, the cursor will always follow the original line.
2. Note (// todo :...)
If you look at the title, you may want to hit me. ThatProgramThe member does not know the comments. Do not translate either // or/* ...... */or <! --... --> (Html/XML annotation ). However
//Todo: Comments
Probably a minority. If you like to use the "task list" to record some things to do, this small function is best for you. You can find the task list window in vs 2010 and click"Menu> View> task list", You can also click the shortcut key"CTRL + W, T". Vs also provides, hack, untodu, unresolvedmergeconflict to mark comments. You canTools> Options> environment> task list"Find and edit/Add/delete tag comments. The figure below shows:
3. Create a region (# region and # endregion)
As code grows, you expect to hide some code, and # region and # endregion are like this. You can hide any code anywhere. Even hidden content does not belong to the same function. You can click +/-next to # region to expand/hide the code. When you place your cursor on the remarks during hiding, Vs will display the hidden code content.
4. Select a word/a string
As you know, double-click a word to select the entire word. Press ctrl to select a word at any position.
Double-click the left side of the first quotation mark of the string to select the entire string. Press ctrl and click the front of the first quotation mark to select the entire string.
5. Put the code in the toolbox
The toolbox is used to place controls. When using the control, we only need to drag the control from the control to the code, which can save a lot of code editing work. Since the toolbox is so convenient, can you put a piece of code with high reusability into the toolbox. Of course the answer is yes.
You can select your code and drag it into the blank area of the toolbox. Your code is saved to the toolbox. Just as you drag a widget into the code page, you can also drag the code into the toolbox. In the future, you can use reusable code just like using controls. This is very convenient. In addition, the toolbox content will not disappear because you close vs. The Toolbox also saves your code when you open vs next time. If you need to view the code saved in the toolbox and do not want to drag it to the code page, you just need to move the cursor over the code icon in the toolbox. :
6. format the code
This is very important, even though Vs will automatically format the code after you press ";" each time. But it is inevitable that the code format will change. For example, after a piece of code is pasted, the code format is often affected. Therefore, it is necessary to know.
Some code for formatting:Select Code> Ctrl + k, F. OrCTRL + E, F.
Format the entire document:Edit-> advanced-> set document format. OrCTRL + k, d. OrCTRL + E, D.
7. switch design/code Diagram
On the ASP. NET page switch (HTML ):CTRL + pgup/Ctrl + pgdn
Switch between Windows Forms:F7/Shift + F7(Code/design)
8. Find the error code.
When an error or warning prompt is displayed in the error list, you can double-click the error or prompt to jump to the statement of the error or warning.
9. Jump to the specified row number
This is useful when there are many codes. In ASP. NET programming, many errors can only be found when running the website, and this error is not prompted in the error list, you can use this tips to jump to the wrong code.
Double-click the row number in the lower right corner of the status bar to jump out of a line number jump form. Or shortcut keyCTRL + GCall up the form. You can also click"Edit-> jump .."Use this function.
10. Quick Search
Move the cursor over the word to be searched and use the shortcut keyCTRL + F3You can jump to the next same word. PressShift + F3You can search up.
11. Find "{/}"
Search: Are you worried? Some of the corresponding tags cannot find the end, and the end is unknown. When you place the cursor in front of "{", Vs will mark the corresponding. You can also move the cursor behind "}" to achieve the same effect.
12. search and replace
When you want to find/replace a string, you can press the shortcut key"CTRL + F"Or"CTRL + H. In addition, vs supports regular expressions and wildcards.
If you want to find/Replace the entire project, you need to use the shortcut key"CTRL + Shift + F"Or"CTRL + Shift + H". Of course, all of this can be found in the menu bar. "Edit-> search and replace ". You can use the shortcut key"CTRL + pause break".
13. bookmarks
Bookmarks are very useful. Anyone who has used Chrome knows that. Bookmarks also apply to. It can help you save the location so that you can write code.
Place bookmarks:CTRL + B, T.
Previous bookmarks:CTRL + B, P.
Next bookmarks:CTRL + B, n.
Delete all bookmarks:CTRL + k, c.
In addition, vs also provides other bookmarks.
14. Jump to definition
When you view the code, you often need to view the original function, which is inevitable. But do not look for functions manually. This efficiency is often very low. You can right-click the function and select jump to definition. You can also use shortcuts.F12.
15. Insert external text as text
"Menu-> edit-> insert a file as text"
The advantage is that you do not need to open the file to copy and paste it.
Maybe you already know these tips. Or, you think these skills are useless. Of course, our most important task is coding. There is no need to spend your thoughts on this. However, when you are used to using these tips, the benefits you bring will not disappoint you. I think it is necessary to master some skills.
In short, let's let others go.
I believe that developers do not pay less attention to efficiency. C # and VB developers all know that we rely heavily on vs, or we are very grateful to. The ability to create dependencies on an IDE indicates that this ide does have its uniqueness. Undoubtedly, VS is a very powerful ide that supports multi-language editing. Supports C #, VB, C/C ++, HTML ...... it has powerful debugging and compilation functions. It eliminates the need to remember the cumbersome processes of installation, environment variable settings, server settings, and compilation. Highly integrated. There are advantages and disadvantages in everything. In the era of agile development, there is no doubt whether vs is worth our use. However, powerful vs has many settings and many skills. Remember some tips that make it easier and quick to use. This is necessary. Everyone remembers some tips. But it is impossible to remember all of them. We should remember some of the things we commonly use according to our own programming habits.
The following are some tips that you may find frequently used during the coding process and hope to help you.
1. Edit rows (copy, cut, delete, switch)
When you stop at the cursor, use the shortcut keyCTRL + C, X, lYou can copy, cut, and delete the entire line of content. Of course, right-click is also acceptable. Compared with the normal copy, cut, and delete operations, this is only the difference between the selected code and the unselected code.
You can use the shortcut key (Shift + ALT + T), Provided that the cursor stays on the line above. After replacement, the cursor will always follow the original line.
2. Note (// todo :...)
If you look at the title, you may want to hit me. The programmer does not know the comments. Why not? // or * ...... */or <! --... --> (Html/XML annotation ). However
//Todo: Comments
Probably a minority. If you like to use the "task list" to record some things to do, this small function is best for you. You can find the task list window in vs 2010 and click"Menu> View> task list", You can also click the shortcut key"CTRL + W, T". Vs also provides, hack, untodu, unresolvedmergeconflict to mark comments. You canTools> Options> environment> task list"Find and edit/Add/delete tag comments. The figure below shows:
3. Create a region (# region and # endregion)
As code grows, you expect to hide some code, and # region and # endregion are like this. You can hide any code anywhere. Even hidden content does not belong to the same function. You can click +/-next to # region to expand/hide the code. When you place your cursor on the remarks during hiding, Vs will display the hidden code content.
4. Select a word/a string
As you know, double-click a word to select the entire word. Press ctrl to select a word at any position.
Double-click the left side of the first quotation mark of the string to select the entire string. Press ctrl and click the front of the first quotation mark to select the entire string.
5. Put the code in the toolbox
The toolbox is used to place controls. When using the control, we only need to drag the control from the control to the code, which can save a lot of code editing work. Since the toolbox is so convenient, can you put a piece of code with high reusability into the toolbox. Of course the answer is yes.
You can select your code and drag it into the blank area of the toolbox. Your code is saved to the toolbox. Just as you drag a widget into the code page, you can also drag the code into the toolbox. In the future, you can use reusable code just like using controls. This is very convenient. In addition, the toolbox content will not disappear because you close vs. The Toolbox also saves your code when you open vs next time. If you need to view the code saved in the toolbox and do not want to drag it to the code page, you just need to move the cursor over the code icon in the toolbox. :
6. format the code
This is very important, even though Vs will automatically format the code after you press ";" each time. But it is inevitable that the code format will change. For example, after a piece of code is pasted, the code format is often affected. Therefore, it is necessary to know.
Some code for formatting:Select Code> Ctrl + k, F. OrCTRL + E, F.
Format the entire document:Edit-> advanced-> set document format. OrCTRL + k, d. OrCTRL + E, D.
7. switch design/code Diagram
On the ASP. NET page switch (HTML ):CTRL + pgup/Ctrl + pgdn
Switch between Windows Forms:F7/Shift + F7(Code/design)
8. Find the error code.
When an error or warning prompt is displayed in the error list, you can double-click the error or prompt to jump to the statement of the error or warning.
9. Jump to the specified row number
This is useful when there are many codes. In ASP. NET programming, many errors can only be found when running the website, and this error is not prompted in the error list, you can use this tips to jump to the wrong code.
Double-click the row number in the lower right corner of the status bar to jump out of a line number jump form. Or shortcut keyCTRL + GCall up the form. You can also click"Edit-> jump .."Use this function.
10. Quick Search
Move the cursor over the word to be searched and use the shortcut keyCTRL + F3You can jump to the next same word. PressShift + F3You can search up.
11. Find "{/}"
Search: Are you worried? Some of the corresponding tags cannot find the end, and the end is unknown. When you place the cursor in front of "{", Vs will mark the corresponding. You can also move the cursor behind "}" to achieve the same effect.
12. search and replace
When you want to find/replace a string, you can press the shortcut key"CTRL + F"Or"CTRL + H. In addition, vs supports regular expressions and wildcards.
If you want to find/Replace the entire project, you need to use the shortcut key"CTRL + Shift + F"Or"CTRL + Shift + H". Of course, all of this can be found in the menu bar. "Edit-> search and replace ". You can use the shortcut key"CTRL + pause break".
13. bookmarks
Bookmarks are very useful. Anyone who has used Chrome knows that. Bookmarks also apply to. It can help you save the location so that you can write code.
Place bookmarks:CTRL + B, T.
Previous bookmarks:CTRL + B, P.
Next bookmarks:CTRL + B, n.
Delete all bookmarks:CTRL + k, c.
In addition, vs also provides other bookmarks.
14. Jump to definition
When you view the code, you often need to view the original function, which is inevitable. But do not look for functions manually. This efficiency is often very low. You can right-click the function and select jump to definition. You can also use shortcuts.F12.
15. Insert external text as text
"Menu-> edit-> insert a file as text"
The advantage is that you do not need to open the file to copy and paste it.
Maybe you already know these tips. Or, you think these skills are useless. Of course, our most important task is coding. There is no need to spend your thoughts on this. However, when you are used to using these tips, the benefits you bring will not disappoint you. I think it is necessary to master some skills.
In short, let's let others go.