#41 Forward and Backward navigation in Visual Studio Editor
Tuesday, February 10 2009
These are great. I already knew the keyboard shortcuts, but I didn't know the toolbar tricks. For once (this is unusual) the tool bar offers a tiny bit of visual help that superceeds the use of the keybaord only tricks. Confused? That's why I like video. You will too. Watch video #41
Visual Studio Tip / Trick #041 English Transcription:
Today's Visual Studio Trick, Trick No. 41 was originally posted by Sara Ford in September 19th 2007.
Today's trick works the same in both in Visual Studio 2005 as it does in 2008. So we'll be demoing this on 2008 product and the tip is forward and backward navigation. So if I have my cursor here and jump to another file and do something here, then jump here. If I wanna go back, the keyboard shortcut is [CTRL]+[_], or I guess that's actually a dash, so [CTRL]+[-] will take you backwards and then [CTRL]+[SHIFT]+[-] will take you forward. A lot of people know those keyboard shortcuts but a little bit of background on whats happening and actually a new little trick that I didn't know about is these toolbars.
So if I hover over the backwards, so I can navigate backwards with [CTRL]+[-], and navigate forward with [CTRL]+[SHIFT]+[-], but there's also this handy little drop down arrow here which shows you the most recent files that have been opened as well as the marks that are in those files that you've gone to. So instead of just going [CTRL]+[-],[-],[-],[-],[-] and try to get back to where you were. Its pretty convenient to see this menu you can get right to a specific place in the file. Now there is some rule this happens when this back mark is actually dropped for you. So if I go to line 19-20-19-20-19-20 and I just keep going back and forth, or up-down-up-down-up-down, those are actually not dropping in backmarks, so there are some rules. And Sara outlines these in her blogs. So the first one is incremental search, so [CTRL]+[I] and everytime you find something, either moving forward or backward, there is a backmark that is dropped. If you do [CTRL]+[G] and go to a specific line, then there is a backmark that is dropped. Also if you move more than 10 lines. So if I [CTRL]+[G] from 13 to 19 and then back to 13, there is not a mark that is added. It has to be greater than 10 lines. There is a backmark that is added during a destructive options. So for example if I delete these lines, then a backmark is added that means I'll be able to navigate forward and backwards to this particular place. Then also when you do straight up [CTRL]+[F] to find, and then navigate with that Find and then finally when you open a new file, there's a backmark that is added at your current cursor position as well as the position that your cursor is on that new file. So again this works the same in both 2005 and 2008. So you at next tip trick.
1 comment(s)
I have been look for that for ages, thanks !