Visual Studio Keyboard Shortcut Tip: Ctrl+-

Posted by: Scott on Writing, on 24 Nov 2008 | View original | NEW Bookmarked: 0 time(s)

I learned this Visual Studio keyboard shortcut from a client a couple of months ago. I use it several times a day now.

Typing the Ctrl key and - (the minus key) returns you to the previous cursor location, be it in the same file or in a different, open file.

Visual Studio maintains your position in a file as a stack. So as you do a Find and jump to a particular location in a file, or right-click on a method or property name and choose Go To Definition Visual Studio keeps track of your position prior to these jumps. You can then 'pop' the position off the stack and return to it by hitting Ctrl+-.

This keyboard shortcut is quite useful when you're bug hunting or trying to understand how some bit of code is working and are drilling down into methods and search results. When you are ready to return to the previous location, which could be in another file or elsewhere in the currently opened file, just hit Ctrl+- to get back! And if you need to get back to the spot before that, hit Ctrl+- again.

Advertisement
Category: Visual Studio | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 1043 | Hits: 23

Similar Posts

  • Visual Studio Tips & Tricks more
  • Two cool debugger tips that I learnt today more
  • Edit SQL 2005 Analysis Server Cube Report Models more
  • Visual Studio Shortcuts more
  • Visual Studio Smart Tag Expansion Tip more
  • I can’t find my Find Dialog in Visual Studio more
  • Did you know? There are many ways to insert a snippet into your code (Lisa Feigenbaum) more
  • Visual Studio Short Keys and Some Tips and Tricks more
  • Visual Studio Tip: Search DevExpress From IDE more
  • Visual Studio Tip: Using Code Snippets more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD