Visual Studio (2005,2008,2010) Tips and Tricks.
#45 Move cursor to top or bottom of screen (without scrolling)
Tuesday, February 10 2009
Wanna get to the top of your screen, but you know PgUp is too far? How about the bottom? This is a cool trick that I find myself using all the time. It saves 100's of ups and downs a day, because you can always get to the place you're interested in faster than up,up,up,up,up,up,up,up.
BONUS Content.
At the end of this video, we talk about debugging your keyboard so if some of your keystrokes don’t work as described, you can use Visual Studio to find out why!
Snippets / Notes:
[CTRL]+[PgUp] = Move to top of page, without scrolling
[CTRL]+[PgDn] = Move to bottom of page, without scrolling
[CTRL]+[SHIFT]+[PgUp] = Move and Select to top of page, without scrolling
[CTRL]+[SHIFT]+[PgDn] = Move and Select to bottom of page, without scrolling
[CTRL]+[Up Arrow] = Leave cursor in current position, but scroll up
[CTRL]+[Down Arrow] = Leave cursor in current position, but scroll down
Visual Studio Tip / Trick #045 English Transcription:
Today’s Visual Studio video Trick video trick number 45 is video repost of Sara Fords original trick of the day 45 about scrolling to the top and the bottom of your editor without actually moving the scroll bar so let’s just create some more text on the screen with some copy paste and if I want to get my cursor now to line 42 most people will tend to use [PgUp] and problem with [PgUp] is that it actually scroll the document so sometimes its visually difficult to follow with what is happening now you can do [CTRL]+[G], 42 [ENTER] and it will take you to right to line 42 or you can also do [CTRL]+[Page Up] and that actually the trick which take the cursor at the top line of your current view and than ofcourse [CTRL] + [Page Down] works as well. You can do [CTRL]+[Shift]+[Page Up] which will select your cursor to the top of the view or if your cursor is in the middle you can use [CTRL]+[Shift]+[Page Down] which will take your cursor at the end of the view.
So I will tell you couple of extra things here [CTRL] + [Arrow Keys] up and down will also scroll your view without having to move the mouse maybe this is a trick on its own and that’s actually same trick that works in Visual Studio 2005 as well as 2008 so you can do [CTRL] + [Page Up] and [CTRL] + [Page Down] and then [CTRL] + [Up] and [Down] arrows, [CTRL] + [Shift] etc almost works the same, that’s the trick we have done.
I will give guys a little bit more information if you have stuck around because when I first tried this trick in Visual Studio 2008 it did not work, the first time I was in an aspx and [CTRL] + [Page Up] took me between design and split and source view and then second I tried inside Java script file which did not do anything either [CTRL] + [Page Up] leaves my cursor where it is, [CTRL] + [Up] & [Down] works but [CTRL] + [Page Up and Down] doesn’t. So I will show you that I finally tried it is C sharp and it worked fine, the way I figured it out is by going to tools, options under environment keyboard and I just pressed control page down here and that shows me the list of all the commands that the control page down key stroke is bound to and you can see that while I am in text editor [CTRL] + [Page Down] dose not edit view bottom so its actually works from the top down depending on where your cursor is inside of Visual Studio so here we have a window next tab but that means if I have me cursor is focused inside solution explorer and I do a [CTRL] + [Page Up] so you see it takes me to the tools box [CTRL] + [Page Down] so it depends where your focus is in Visual Studio and which of the command take the precedence. May be somebody can answer this in the comments but I don’t know why [CTRL] + [Page Up] and [Down] does not work in a Java script file but does works in C sharp file because if you look in the binding of the stroke it is simply bound to the edit view button inside the text editor so I guess a simpler question is why there is a different editor for Java script and text editor, maybe we figure it out in comments.
0 comment(s)