---
title: "More VS.NET Tips & Tricks"
url: "https://osherove.com/blog/2003/5/1/more-vsnet-tips-amp-tricks.md"
canonical: "https://osherove.com/blog/2003/5/1/more-vsnet-tips-amp-tricks.html"
published: "2003-05-01T08:35:00"
updated: "2003-05-01T08:35:00"
tags: [".Net Original", "Tips & Tricks"]
author: "Roy Osherove"
description: "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…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# More VS.NET Tips & Tricks

By Roy Osherove May 1, 2003 In [.Net Original](https://osherove.com/blog/category/net-original), [Tips & Tricks](https://osherove.com/blog/category/tips-tricks)

**Historical article** · Originally published May 1, 2003; technical details may be outdated.

**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

## More in .Net Original

[All posts in .Net Original](https://osherove.com/blog/category/net-original)

- May 4, 2003

    ### [Typed Datasets Are Not Always The Answer](https://osherove.com/blog/2003/5/4/typed-datasets-are-not-always-the-answer.html)

- May 1, 2003

    ### [EchoStream Class](https://osherove.com/blog/2003/5/1/echostream-class.html)

- Apr 30, 2003

    ### [A VS.NET 2003 Registry Tweaker Don Could Use](https://osherove.com/blog/2003/4/30/a-vsnet-2003-registry-tweaker-don-could-use.html)

- Apr 30, 2003

    ### [Advanced Dataset Helper Classes](https://osherove.com/blog/2003/4/30/advanced-dataset-helper-classes.html)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
