Go To a Line Without Using the Go To Line Dialog


Keyboard:  CTRL + D [find combo box]; CTRL + G [goto line]; ESC [focus back to the editor]
Command:  Edit.GoTo [line number]
Versions:  2008,2010
Published:  6/2/2010
Code:  vstipEdit0067

 

This tip is for those who don't like dialog boxes popping up all the time in their face.  You can execute the GoTo command without invoking the Go To Line dialog box:

image

 

First, press CTRL + D to go to the Find combo box and type in the line number you want to go to:

image

 

Press CTRL + G to go to the line number then press ESC to return the focus to the Editor.

 

NOTE:  Do not press ENTER inside the Find combo box as it will search for the number you typed in your code instead of taking you to the line number.

Comments (5)
  1. Daniel Rose says:

    You can also use the CTRL – # shortcut to go to the Find combo box. Useful for Resharper uses, since it replaces CTRL + D with "Duplicate line".

  2. krishna says:

    Why would anyone want to press two shortcuts instead of just one (CTRL+G)

  3. zainnab says:

    I wondered that myself until I pitched the tip to some friends and one of them in particuar seriously hates modal dialogs so they use this technique.  I guess with muscle memory you can do it pretty quick.

  4. Jepoy says:

    Its not working the Ctrl + G in vs2008. Do i need to setup anything?

  5. zainnab says:

    Jepoy 🙂

    No setup required just press CTRL + D then type a number then press CTRL + G and it should take you to that line number.

    Z

Comments are closed.

Skip to main content