CodeRush Tip – Enhance Studio’s Find command.

“How can I easily return to where I started having used Visual Studio’s find command to locate something?”

One way of achieving this is….

  • Drop a marker (Alt+Home) before you perform your search.
  • Hit Esc to return to the marker when you’re finished looking around.

However that’s a lot to remember to do, so why not have CodeRush automate a little more for you.

  • Create a new shortcut (Details here)
  • Set key 1 to Ctrl+F
  • Set command to MarkerDrop
  • Check the checkbox that says “after executing this command, pass shortcut to IDE for default handling
  • Set context to Focus\Documents\Source\Code Editor
  • Click Ok

CodeRush should now drop a marker whenever you bring up the Find Dialog. which means you only have to remember to hit Esc to collect them.

Bonus marker facts

  • Markers are stored in a stack formation so that they leave a sort of trail of breadcrumbs.
  • Each successive press of Alt+Home adds a marker to the top of the stack.
  • Pressing Esc “Collects” a marker, removing it from the top of the stack and navigating you to the location it represents.
  • Collecting a marker doesn’t just restore you to the position in the file it represents, it also restores the view and selection.
  • Markers are also removed from the stack when the files they refer to are closed.
2 comment(s)
Adam Lonsdale.

Lifesaver! Thank you so much for pointing this out, will save a huge amount of time (:

12 April, 2011
Graeme Ross

Gold

13 April, 2011

Please login or register to post comments.