1

Possible Duplicates:
Visual Studio 6 tips and tricks
Visual Studio 2005 Shortcuts
Favorite Visual Studio keyboard shortcuts

I am a big fan of shortcuts in VS2008, it can save a lot of time and keep your fingers on the keyboard instead of the mouse.

Recently I downloaded the entire list of keyboard shortcuts for VS 2008 and went through them all finding my favourites.

Currently here are the top one's I use:

  1. Shift + DEL: Deletes an entire line
  2. Ctrl + Shift + F10: Brings up the Using / Resolution box
  3. cw[tabx2]: Inserts Console.Writeline code
  4. ctor[tabx2]: Inserts default constructor code

What other ones do people know that saves time / are actually useful?

Community
  • 1
  • 1
Chris
  • 26,744
  • 48
  • 193
  • 345

10 Answers10

4

F12 Jump to definition

SHIFT + F12Find al references

CTRL + MINUS Jump back to previous cursor location

CTRL + SHIFT + MINUS Jump forward to last cursor location

CTRL + K , C Comment out currently selected code

CTRL + K , U Uncomment currently selected code

CTRL + K , F Format selected code

CTRL + K , D Format document

F5 Start Debugging

F6 Build Solution

F7 Switch to code view

Shift+ F7 Switch to design view

These are the ones I use most.

PS. Microsoft released keybinding posters for Visual Studio.

Agilanbu
  • 2,747
  • 2
  • 28
  • 33
RuudKok
  • 5,252
  • 2
  • 26
  • 27
3

Incremental Search - Ctrl+I

Search your code, just like in Firefox/IE8. Doesn't work with regions however.

Heinrich Cloete
  • 702
  • 5
  • 12
David Wengier
  • 10,061
  • 5
  • 39
  • 43
  • 2
    it does if you have selected "search hidden text" on a previous normal search. – Nikos Tsokos Jun 02 '09 at 10:39
  • Really? That didn't have any effect on incremental search last time I tried it, but I will have to try again. This could end the region debate in our company! – David Wengier Jun 02 '09 at 10:55
  • oups!!! no it doesnt. I wish i could at least have a way to expand all regions (the opposite of ctrl+m+o) – Nikos Tsokos Jun 02 '09 at 11:14
  • At least I'm not going crazy :) Ctrl M, P will stop outlining, which has basically the same effect as expanding all – David Wengier Jun 02 '09 at 12:01
  • CTRL+M,P doesnt seem to expand anything. At least not in VS 2005 VB.NET i am currently working on. Will try it at home on VS 2008 and see how it goes... – Nikos Tsokos Jun 02 '09 at 13:16
2

Ctrl+. : Opens the current smart tag in the text editor. This saves sooo much time when you use smart tags.

By the way, the tab-tab things are code snippets rather than short-cuts. Shouldn't make a difference for this question though.

OregonGhost
  • 23,359
  • 7
  • 71
  • 108
1

Ctrl+M+O : collapses all regions and methods

Ctrl+M+M : toggle outlining for the current region or method

Heinrich Cloete
  • 702
  • 5
  • 12
Thomas Levesque
  • 286,951
  • 70
  • 623
  • 758
0

Most of my "shortcuts" come from ReSharper and ViEmu, so R#'s Alt+Enter and various Vim features top my list.

Brian Rasmussen
  • 114,645
  • 34
  • 221
  • 317
0
F5, F5, F5 and F5
Robin Day
  • 100,552
  • 23
  • 116
  • 167
  • That may be, but I can hand on heart, honestly say, it is the Visual Studio shortcut that I use the most. – Robin Day Jun 02 '09 at 10:34
  • CTRL + F5 runs your program but detaches it from the debugger - makes it faster :) – Chris Jun 02 '09 at 10:37
  • 1
    For some reason, in many cases, I click on the Debug button rather than press F5. Don't know, maybe it's because the coding (i.e. typing) phase is over then ;) – OregonGhost Jun 02 '09 at 10:57
  • @OregonGhost: I too can't figure out why I dont press F5 and almost always click on debug button !! pretty strange. – Kunal S Jun 02 '09 at 11:00
0

Shift + F11 -> Set the Next Execution Statement [while debugging]

abhilash
  • 5,605
  • 3
  • 36
  • 59
0

Shift+Alt+F10 > include namespace

Ctrl+R+E > Refactor, ecapsulate field

Shift+F6 > build current project

Ctrl+Alt+Q > Quick Watch in debugger

Ctrl++ and Ctrl+- > navigate back and forward in code

F2 > Refactor, Rename > my favorite one

Tevo D
  • 3,351
  • 21
  • 28
Andrija
  • 14,037
  • 18
  • 60
  • 87
0

Shift + F5: Stop debugging

Rockcoder
  • 8,289
  • 3
  • 32
  • 41
0

I use Resharper that offers the major refactoring and search functionallity with different shortcuts.

crauscher
  • 6,528
  • 14
  • 59
  • 85