[Reprinted] animated demonstration of common shortcut keys of VISAUL Studio
During code development, we often use the keyboard and mouse to collaborate frequently. However, switching between the two tools will affect our development speed, if all the operations can be completed by using only the keyboard, the development efficiency will be greatly improved. Therefore, the flexible application of the Visual Studio keyboard shortcut can achieve twice the result with half the effort.
In order to facilitate future viewing, I will divide the results into the following parts:Code editing,Search and replace,Code beautification,Code navigation,Visual Studio windowAndDebuggingAt the end of the page, you can modify the default shortcut key. At the same time, after referring to the article of resource [2], we found that the use of animation demonstration is not only intuitive but also easier to recall in the future, so we also tried to use the GIF recording software as a shortcut key with an animation demonstration.
- Code editing
- Search and replace
- Code beautification
- Code navigation
- Visual stuido window
- Debugging
- Modify shortcuts
- Reference resources
The shortcut described in this article applies to C #. For users in other languages, see.
Code editing: Quickly select the stuff between quotation marks
Place the cursor on the left side of the left quotation mark and double-click it. If the @ symbol or string contains a line break, it can only be placed on the left.
Block Selection and editing
Press and hold the Alt key, and then select a block with the mouse to copy, paste, and edit the block.
Delete the row where the cursor is located
CTRL + Shift + L
Because you only need to place the cursor in a row to delete the row, thus saving the overhead of selecting a line of code.
Cut the row where the cursor is located
CTRL + X or Ctrl + L
Insert a blank line up or down the cursor
CTRL + enter over the cursor
CTRL + Shift + enter under the cursor
Rename
F2
A powerful rename can help us modify all the places that reference the object, thus reducing errors caused by forgetting to modify the object.
If you cannot watch the animation, click the image to enlarge it.
Forced smart sensing
CTRL + J
Forced display method overload Parameters
CTRL + Shift + Space
Comment code
CTRL + e, CTRL + c
Uncomment code
CTRL + e, CTRL + u
Move the current row down
Alt + Shift + T
Enable Smart Tag
Shift + ALT + F10 or Ctrl +. (point)
Thanks to @ BCE, I almost forgot this useful shortcut key.
When the content you entered in the editor changes or becomes faulty, you will see a small horizontal movement below the content. When you move the mouse over the small horizontal movement, you can expand this tag. This is the operation that vs prompts you to execute now. For example, when you modify a variable name, it will prompt you whether to replace all referenced locations, for example, if the namespace of a class you added is not referenced, it will prompt you whether to reference the namespace.
Search and replace in the current document
CTRL + F
In the current document, use the last searched keyword for search.
Search down F3
Shift + F3 Lookup
Replace in the current document
CTRL + H
Code beautification and formatting code snippets
CTRL + e, CTRL + F
Format the entire document
CTRL + e, CTRL + d
Code navigation collapse/expand code blocks
If you find that there is a-sign in front of your code segment, the code segment is foldable.
CTRL + M, CTRL + m
Collapse any block
CTRL + M, CTRL + H (IDE) folding
CTRL + M, CTRL + U (nhide) Expand
Go to definition
F12
You can quickly help us position the cursor to the variable definition or type definition.
Search for references
Shift + F12
You can quickly find all the places where this object is used.
Go
CTRL +,
Scenario example: the project structure is complex and the number of types is large. I suddenly want to see a user-defined enumeration member, but I cannot quickly find out where to use this enumeration in the currently opened file, in this case, you can use Ctrl + to quickly locate the file defining the enumeration.
Locate a row
CTRL + G
Locate the brackets
CTRL +]
You can use this shortcut when the content in a bracket ({}, (), []) is too long to quickly locate the other end. When using the tool, place the cursor at the side of the brackets (left and right ).
Go to document header and end
CTRL + home | Ctrl + end
Locate the top and next editing location
Last position Ctrl +-
Next location Ctrl + Shift +-
Locate the previous highlighted reference
CTRL + Shift + up and down arrows
When you place the cursor on a word, Visual Studio intelligently highlights all the places where the word appears, you can use the following shortcut keys to jump between the highlighted words.
Visual stuido window switch Tab
CTRL + Tab
Close current tab
CTRL + F4
Debug and compile the entire solution
F6
Compile and run
F5
Set or cancel a breakpoint
F9
Modify shortcuts
If you think the preset shortcut keys are not easy to use, you can adjust them using tools/options/keyboard.
1. Find the shortcut key you want to modify and remove the original shortcut key settings.
2. Enter the shortcut key you want and click Allocate ".
GIF animation demonstration
Reference resources
[1]. predefined keyboard shortcuts
[2]. Common shortcut keys for Visual Studio
Http://blog.chenxu.me/post/detail? Id = 0543017f-1c98-4bd6-b87c-8bd19b4d752c
Label: Visual Studio