Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quickly navigating through an ASP.NET MVC app in Visual Studio

I spent a fair bit of time developing Rails apps in VIM with an amazing plugin called Rails.Vim

Whenever I wanted to navigate to a Model I would hit:

esc :Rmodel topic[enter] to find the topic model.

In this mode tab completion works so I could hit :Rmo[tab] to[tab][enter]

(for an added bonus :RSmodel topic[enter] would split the window and open the model in the split

Or :RTmodel topic[enter] would open it in a new tab)

Similar shortcuts exist for navigation to javascript, css, views, helpers, controllers and so on.

Is there a similar plugin for Visual Studio 2010 that would allow me to approximate this kind of behavior, allowing me to navigate my MVC project with keyboard shortcuts only?

like image 750
Sam Saffron Avatar asked Oct 13 '10 00:10

Sam Saffron


2 Answers

To navigate to a method/class/type definition that is visible on your current screen (I.E. the method/class/type is properly being used in a piece of code you're viewing), place your cursor on it and hit F12.

To navigate to a class/method/property/field etc. anywhere in your project, press CTRL + , then start typing to search for it. The results will auto filter.

The CTRL + , search uses the same new search standards as IntelliSense in 2010. So typing MSA in the search will return MailServerAddress etc.

I'm not sure there exists anything beyond the normal search functionality for CSS/JS/Views.

Update

CTRL + , Does indeed filter by file names. So searching for views by file name works.

like image 100
Omar Avatar answered Sep 29 '22 07:09

Omar


You can also customize the shortcut keys to navigate from the controller to the views and back http://ebersys.blogspot.com/2011/05/visual-studio-aspnet-mvc-flip-quickly.html

like image 45
BlackTigerX Avatar answered Sep 29 '22 06:09

BlackTigerX