Here are some extremely helpful keyboard shortcut keys for Visual Studio 2008. You probably know most, but some you won't know. For instance, did you know that Ctrl+. is the same as Sift+Alt+F10?
Note: Some of the shortcuts won't work in all environment configurations (web, C#, etc).
To use, hold down the control key and hit the key combination. Works on the whole document, a specific line, or a selection of code.
Go to Definition (F12) Navigate to the definition of the method or variable. Super useful.
Find all References (Shift + F12)
Update References/ Add Using Statement (Ctrl +. or Shift +Alt +F10) I'm referring to the underline that appears under a variable to perform an action like add a using statement, or refacter a method or class name. Not sure what it's called but I use it all the time. Ex: ClassName
List Members (Ctrl +J or Ctrl +K, L) Displays the autocomplete list for classes, methods, or properties.
List Parameter Info (Ctrl +Shift +Space or Ctrl +K +P) Lists the parameters for a method. Use this shortcut when your cursor is inside the parenthesis of a method.
Auto Format (Ctrl +K, D or Ctrl +E, D) Formats C#, VB, ASPX, Javascript, CSS, XML, XSL, and HTML code according to generally accepted formatting standards for the respective programming language. Makes code look nice and neat.
Quick Watch (Ctrl +Alt +Q) Highlight some code and hit these shortcut keys to display the Quick Watch dialog.
Comment / Uncomment (Ctrl +K, C / Ctrl +K, U) Comments or uncomments a block of code. Works with C#, VB, ASPX.
Code Bookmarks Use these to bookmark a line of code. You can cycle through the bookmarks across any file within a project. Bookmarks come in very handy, try it out.
Set/Unset Bookmark (Ctrl +K, K) Next Bookmark (Ctrl +K, N)
Surround With (Ctrl +S) Surrounds a block of code with a code snippet.
Build & Debug Shortcuts Set/Unset Breakpoint (F9) Build (F6 or Ctrl +Shift +B) Start Debugging (F5) Start Without Debugging (Ctrl +F5) Stop Debugging (Shift +F5) Continue (F5) Step Over (F10) Step Into (F11) Step Out (Shift +F11) Attach to Process (Ctrl + Alt + P)
That's it for now, feel free to add more in the comments below. I'll try to update this post periodically.
Hi!
ReplyDeleteI was just wondering whether (Ctrl +K, C / Ctrl +K, U) really works with CSS.
Ahh you caught me.. Comment/uncomment doesn't work for CSS files unfortunately. I wonder if MS will add support in 2010.
ReplyDeleteHi Rob!!
ReplyDeleteHere are few more
Delete All Break Points (Ctrl +Shift +F9)
Code Snippet Manager (Ctrl +K,B)
Attach to Process (Ctrl + Alt + P)
Great post.
ReplyDeletethanks
ReplyDeleteVery Helpful, great job!
ReplyDeleteSurround With is (Ctrl + K,S)
ReplyDeleteI really enjoy reading your blog as the postings are so simple to read and follow. Outstanding. Please keep it up. Thanks.
ReplyDeleteDiet Solution Program Review
Diet Solution Program
I am software developer and these shortcuts will really minimize the time I use to code. these shorcuts would be really of use to me thanks
ReplyDeleteAw, this was a really quality post. In theory I'd like to write like this too – taking time and real effort to make a good article… but what can I say… I procrastinate alot and never seem to get something done.
ReplyDeleteawesome post..thanks to author..
ReplyDeleteඑල එල...නියමයි...බොහොම ස්තුතියි...
ReplyDeletenice tips..... keep it up
ReplyDeletenice tips.....but not flexible for VC++ settings......
ReplyDeleteThanks, very useful... :)
ReplyDeleteHow about print and print options?
ReplyDeleteMarc
hi ROB VOLK,
ReplyDeleteThanks very helpful post..
Thanks and regards,
kaviprashu