Keep your hands on the keyboard
Keyboard shortcuts I like to use most
Have you ever had the expectation that you didn't have to leave the keyboard while you were working on your development inside Visual Studio? If you are an advanced user, you will certainly enjoy the rapid experience of using keyboard shortcuts to perform a variety of operations. I'm sure most developers are already familiar with some of these shortcuts. Use F5 to perform debug.start, F10 execution debug.stepover, F4 execution view.properties, and so on. There are, however, several other, less-known but extremely useful keyboard shortcuts. In the following table, I list some of the shortcuts I like to use most.
|
|
f7 |
|
f9 |
|
f12 |
|
Fast forward and backward navigation in the go To definition stack. |
shift+f12 |
|
ctrl+m, ctrl+m |
in editor Expands and collapses the code snippet structure. |
|
shift+alt+enter |
|
ctrl+i |
incremental search. |
Create keyboard shortcuts quick look-up table
Most developers don't understand this, but in fact, Visual Studio defaults to providing more than 450 keyboard shortcuts. However, there is no easy way to find all keyboard shortcuts within Visual Studio. You can write a simple macro that iterates through all the default keyboard shortcuts and finds the actions that they correspond to. The following (Listing 1) lists the code for this macro.
public Module Module1
Public Sub listshortcutsinhtml ()
' Declare a StreamWriter
Public Sub writehtmls Tart (ByVal SW as System.IO.StreamWriter)
SW. WriteLine (" SW. WriteLine (" SW. WriteLine ("<title>")
SW. WriteLine ("Visual Studio keyboard shortcuts")
SW. WriteLine ("</title>")
SW. WriteLine (" SW. WriteLine ("<body>")
SW. WriteLine (" SW. WriteLine ("<font size=" "2" "face=" "Verdana" ">")
SW. WriteLine ("<table border=" "1" ">")
SW. WriteLine ("<tr bgcolor=" "#018FFF" "><td align=" "Center" "
<b>Command</b></td> <tdalign= "" Center "><b>Shortcut</b></td></tr>")
End Sub
Public Sub Writehtmlend (ByVal SW as System.IO.StreamWriter)
SW. WriteLine ("</table>")
SW. WriteLine ("</font>")
SW. WriteLine ("</body>")
SW. WriteLine (" End Sub
End Module
Listing 1: Macros that generate keyboard shortcuts in HTML files