开发者

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

开发者 https://www.devze.com 2023-01-19 22:45 出处:网络
I spent a fair bit of time developing Rails apps in VIM with an amazing plug开发者_JS百科in called Rails.Vim

I spent a fair bit of time developing Rails apps in VIM with an amazing plug开发者_JS百科in 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?


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.


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


You should try the combination Ctrl + ,. It opens a search box that lets you search for classes, files, methods, etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号