Using Peek Definition in Visual Studio 2013

Recently whilst coding with Visual Studio I found a new feature called Peek Definition. This is similar to Go To Definition, but Peek Definition shows in a pop-up window.

This feature is available in C#, Visual Basic and C++ code.

Important: You can't see this feature in Visual Studio 2014 express edition.

Please see the following screen to open a peek definition window.

If you want a peek at the Student class in the following code:



Then right-click on Student and click on Peek Definition as in the following:





If there are multiple portions of the class (a partial class) for Student then a list of portions are displayed at the right of the code definition view and also it starts changing the code in the peek window that is opened as a separate tab.





The following are the shortcuts for the Peek Definition window:

Functionality Keyboard shortcut
Open the definition window Alt+F12
Close the definition window Esc
Promote the definition window to a regular document tab Shift+Alt+Home
Navigate between definition windows Ctrl+Alt+- and Ctrl+Alt+=
Navigate between multiple results F8 and Shift+F8
Toggle between the code editor window and the definition window Shift+Esc

I hope this helps your productivity whilst using Visual Studio.


Similar Articles