views:

2913

answers:

16

Recently , I found some shortcut key really helpful which I never used before . Such keys like 'F7' ,'F3' ,'Ctrl+g' help me a lot when editing and debuging. What are your most frequently used shortcut keys in visual studio?

+1  A: 

including Resharper's shortcuts:

  • Ctrl-Shift-B (build)
  • F12 (go to definition)
  • Shift-F12 (find usages)
  • Ctrl-minus (go to last location)
  • Alt-Shift-L (go to current file in the solution explorer)
  • Alt-\ (find member)
  • Ctrl-T (find type)
  • Ctrl-Shift-T (find file)
  • Shift-Esc (close current dialog)
  • Ctrl-Shift-S (save all files - VS tends to forget)

EDIT: added explanations

orip
How about including what each of those do next to them?
Simucal
which keys are used to collapse all projects in vs 2008 solutuion
Nimesh
A: 

Ctrl-B which for me is build current project. I use it less in VS2008 SP1 with the error highlighting so Ctrl-D which for me is Go To Definition is starting to edge it out.

ShuggyCoUk
+1  A: 

Ctrl-D and then ">of $filename" (open filename), Ctrl+K+C (comment selection), Ctrl+K+F (format), Ctrl-X and Ctrl+C on a line to cut or copy the entire line

Jasper Bekkers
Also Ctrl-L to cut line
Ruben Bartelink
See also http://www.chinhdo.com/20070920/top-11-visual-studio-2005-ide-tips-and-tricks-to-make-you-a-more-productive-developer/
Ruben Bartelink
A: 

The list is endless. To maximize readble code space, I've removed all my toolbars. If I want to do it, I have to know the keyboard shortcut for it.

Aside from the basics, I constantly use things like Ctrl-M,O, Ctrl-K,C, Ctrl-K,U, Ctrl-K,D, Ctrl-Alt-E, Ctrl-Alt-P. I have also made a little smiley-face button for "Remove and Sort Usings" because navigating through the right-click menu takes too long and it doesn't have a hotkey that I know of.

askheaves
You can run Visual Studio in fullscreen mode as well! I've hooked it up to F11.
Jasper Bekkers
You could always map a keyboard shortcut to Remove and Sort usings
John Sheehan
+2  A: 

The most used keyboard shortcut is Ctrl-Tab to switch between tabs.

Another one I use alot is Ctrl-I to start incremental search.

M4N
A: 

I use many, but most useful I think is ctrl+k k for setting a bookmark and ctrl+k n for going to next bookmark and ctrl+k p for previous

Makach
+4  A: 

Control-. for bringing up the smart tag for adding namespaces, renaming/refactoring, etc.

I also remapped Ctrl-B to build, Ctrl-Shift-P to Build Selection (in a sense, Build Project) and Ctrl-W to close window.

John Sheehan
how do you remap shortcuts in VS?
Cam
Actually, I figured it out: Tools>Options>Environment>Keyboard
Cam
+1  A: 

Shift + F6 to build current project, Shift +F5 to stop debugging

+7  A: 

I always use the debugging keyboard shortcuts - F9 (toggle breakpoint), F10 (step over) and F11 (step into). I can't believe that some of my coworkers actually use the toolbar buttons for this - it's insanely more efficient to use the shortcuts.

Andy
A: 

I never can remember shortcuts, but Ctrl - . is one of the few I can remember and use often. With Resharper installed, Alt Enter is Ctrl . on steroids. Both intelligently resolve a variety of errors or refactorings.

Daniel
A: 

I use the bookmark shortcuts alot: Ctrl-K Ctrl-K to create a bookmark, Ctrl-K Ctrl-N to cycle through them.

Ctrl-Shift-B to build is probably the most executed though.

Jim Petkus
+3  A: 

Standard VS keys of F12 for going to the definition and then CTRL+"-" to go back to where I was before that.

Probably the two shortcuts that get me around VS and my code quicker than any other.

John_
+1  A: 

CTRL-K CTRL-C for comment selection and CTRL-K CTRL-U for uncomment selection (They may be mapped to CTRL-E CTRL-C and CTRL-E CTRL-C in some standard keyboard mappings, but the first two will generally still work...)

Arjan Einbu
A: 

Ctrl+Shift+F9 to delete all the break points in a solution. Very handy when people leave them spattered all over the solution!

Alex
Ctrl-Alt-B to view the list and then you can selectively disble thme either
Ruben Bartelink
+1  A: 

two more:

Alt+Ctrl+C for Call Stack Alt+Ctrl+I for Immidiate window (Both helpful while debugging)

A: 

need short ket to change the paths from one project to other.......?

Mahesha