---
title: "A cool Selection Expansion macro"
url: "https://osherove.com/blog/2004/3/27/a-cool-selection-expansion-macro.md"
canonical: "https://osherove.com/blog/2004/3/27/a-cool-selection-expansion-macro.html"
published: "2004-03-27T22:18:00"
updated: "2004-03-27T22:18:00"
tags: ["Tips & Tricks"]
author: "Roy Osherove"
description: "David Scott decided he would really really like a feature that CodeRush has - Selection Expansion , where if you press a shortcut, the selection of text in the IDE expands into the next bigger logical block (”Single…"
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/"
---

# A cool Selection Expansion macro

By Roy Osherove March 27, 2004 In [Tips & Tricks](https://osherove.com/blog/category/tips-tricks)

**Historical article** · Originally published March 27, 2004; technical details may be outdated.

[David Scott](http://www.idiotproof.org/DasBlog/default.aspx) decided he would really really like a feature that [CodeRush](http://www.eagle-software.com/coderush.htm) has - _Selection Expansion_, where if you press a shortcut, the selection of text in the IDE expands into the next bigger logical block (”Single line->Encapsulating if()block->whole method-> Whole class-> and so on...).

[So he wrote a macro that does it and made it available for download](http://www.idiotproof.org/DasBlog/PermaLink.aspx?guid=84a07b84-6023-4b36-a9a6-641845d84459). Very cool.

I wish he had a macro that does the opposite too though :)

## More in Tips & Tricks

[All posts in Tips & Tricks](https://osherove.com/blog/category/tips-tricks)

- Apr 29, 2004

    ### [Unblocking an attachment blocked by outlook](https://osherove.com/blog/2004/4/29/unblocking-an-attachment-blocked-by-outlook.html)

- Mar 27, 2004

    ### [VS-Styler :Toggle and save your VS.Net font and color settings instantly](https://osherove.com/blog/2004/3/27/vs-styler-toggle-and-save-your-vsnet-font-and-color-settings.html)

- Feb 29, 2004

    ### [Problem And Solution: "Login failes for some users on a DotNetNuke based portal"](https://osherove.com/blog/2004/2/29/problem-and-solution-quotlogin-failes-for-some-users-on-a-do.html)

- Feb 6, 2004

    ### [Doing Test Driven Development with no DLLs](https://osherove.com/blog/2004/2/6/doing-test-driven-development-with-no-dlls.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/
