How to jump to the region header from the endregio

2019-01-24 05:23发布

If i have the following

#region
blah;
blahblah;
.....
moar;
#endregion

how can i jump to the top #region label if i see the #endregion tag on my screen?

Is there a short cut?

4条回答
\"骚年 ilove
2楼-- · 2019-01-24 05:40

Ctrl+] will jump between the start and end of blocks. I just tested, and it works for #region blocks for me in VS2010.

Edit: The relevant command is Edit.GoToBrace

查看更多
叛逆
3楼-- · 2019-01-24 05:41

The answer is Ctrl + ] as already answered by @TheEvilPenguin.

But I thought to add this awesome link for other shortcuts as well, which can be helpful in speeding up routine tasks in VS.

EDIT : Save the link page as html in your system, as the link might expire in future.

查看更多
乱世女痞
4楼-- · 2019-01-24 05:47

For Visual Studio 2015, Ctrl + ] doesn't work anymore. But you can use the following:

  1. Click on region
  2. And use following shortcuts: Ctrl + shift + ↑ and Ctrl + shift + ↓
查看更多
相关推荐>>
5楼-- · 2019-01-24 05:56

I don't believe there's a standard shortcut in Visual Studio.

Within Visual Studio's options dialog, I did a search through all available commands for anything containing the word "region":

Region commands

But didn't find anything related to navigation, just expand/collapse.

Addins like Resharper and CodeRush may give you what you want, if you have the budget for it. (And they do a lot more besides.)

查看更多
登录 后发表回答