What are your favorite, but less obvious, Visual Studio 2008 tips and tricks?

The nuance of the question is what are the features of the Visual Studio environment, that not everyone knows about, that you have come to depend on and that you would like others to know about.


The best tricks I find come across Sara Ford's blog - Hidden Features of Visual Studio (2005-2010)?

I'd recommend you check out the Webcast for session TL46 from PDC 2008: Microsoft Visual C# IDE: Tips and Tricks. The speaker points out some non-obvious things, and also talks about the free, recently released "express" version of CodeRush and some of the things that it can do.


Control+minus : goes back to the previous editor position. This is especially helpful if you have temporarily navigated away from your editting position because you've looked up a symbol declaration or searched for a string. It works between files too. Control+Shift+minus visits the editor positions in the opposite direction.

Dragging the current location marker in the source window during a debug session to skip statements or re-execute statements. In the debugger the yellow "current statement" arrow is draggable.

In C++, a really handy thing to have is to open the "Code Definition Window". So no matter what .cpp file you are editing, the corresponding .h window is displayed in this extra window.

Ctrl + . to automatically show smart tags, so Ctrl +. then enter will quickly open and use the smart tag value.

Ctrl + K + C to comment out a selection

Ctrl + K + U to uncomment a selection

Ctrl + . for smart tags

Ctrl + space to bring up intellisense

I also like to use the prop and foreach code snippets.

Ctrl + K + F to format a selection. Fixes all my crappy indenting messes.

Ctrl + Alt and mouse select allows vertical selection of characters.

The ability to unload projects and then to edit them using the text editor. You do this by right-clicking on a project and selecting "Unload Project", the right-clicking on the project and select "Edit project". Sometimes editing the text of the project files is faster than carrying out operations using the gui. For example, having to copy a long list of references from one project to another. Once the editing is done, you right-click on the project and select "Load Project" to return to the normal project view.

Leaving bookmarks in your code, with Ctrl + K + K, then you can navigate to the next bookmark with CTRL + K + N , and to the previous with CTRL + K + P.

Interactive search with Ctrl+I is great for fast searching through a file.

Highlight all your using statements in VS 2008 and go to Edit -> IntelliSense -> Organize Usings -> Remove Unused Usings :-)

Install R# ;-)

Ctrl+K, Ctrl+C to comment out the selected block of text. Ctrl+K, Ctrl+U to uncomment the text.


Ctrl K + D, formats code-behind AND HTML (Indenting, etc)

It is my new favorite trick.

Also, I use ctrl + m + o frequently, which collapses all methods.

Executing C# statements interactively in the debugger using the Immediate Window. You can type statements into the Immediate window of the debugger, and it will execute them in the context of the current statement. Of course, only statements that make sense in the context of the current statement will execute.

Need Your Help

Setting a relationship between Users to access a resource

ruby-on-rails many-to-many has-and-belongs-to-many

I'm teaching myself Rails and I'm trying to setup a collaboration relationship kind of like Github adds collaborators to projects. My models look like this:

what's the better call a function with all needed code inside, or a function with an other function inside with the needed code?

java javascript php c++

I don't know how to formulate the question more accurately(because i'm not so good in English) but let me explain with some example (I work mostly on php ,javascript and java):