Search The Blog
About this site

@RoyOsherove

Subscribe!

This site aims to connect all the dots of my online activities - from tools, books blogs and twitter accounts, to upcoming conferences, engagements and user group talks.

from 5whys.com
Twitter: @RoyOsherove
My Book: The Art of Unit Testing
Latest Posts
« How to Pass A Microsoft Interview - SDE/T Edition | Main | A VS.NET 2003 Registry Tweaker Don Could Use »
Thursday
May012003

More VS.NET Tips & Tricks

For you keyboard junkies out there:

  • Cut the current line - CTRL+L (Saves you that 'long' HOME,SHIFT+END,CTRL+X)
  • Delete the current line - CTRL+SHIFT+L (Saves you that 'long' HOME,SHIFT+END,DEL)
  • Move to the closing or opening of the current block - CTRL+[

 

  • Here's a nice little macro to turn your selection into a region:

Sub OutlineSelection()

Dim objTextDoc As TextDocument

Dim title As String = InputBox("Enter the title for the outline", "Outline code")

objTextDoc = DTE.ActiveDocument.Object("TextDocument")

objTextDoc.Selection.Insert("#region " & title & vbNewLine, vsInsertFlags.vsInsertFlagsInsertAtStart)

objTextDoc.Selection.Insert(vbNewLine & "#endregion ", vsInsertFlags.vsInsertFlagsInsertAtEnd)

objTextDoc.Selection.SmartFormat()

End Sub

 

Save it in you macro-editor(ALT+F8) .

then go to tools-options->environment-keyboard and find that macro.

Highlight it and select the shortcut youd like to run it from(I use CTRL+M,CTRL+N).

 

  • Outline a text selection for a Standard Non-Code file (My favorite)

sometimes your opening files in the VS.NET editor that are not code files.

You have no outlining support in these files... or do you?

Select some text in the open editor and press CTRL+M,CTRL+H. tada! your selection is now collapsed.

Press CTRL+M,CTRL+U to stop the outlining

PrintView Printer Friendly Version

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>