Go to Matching Brace in Visual Studio?

2019-01-05 07:11发布

Is there a way in Visual Studio 2008 to go from a closing brace to its opening brace? I've found a fair amount of stuff about highlighting the brace, but nothing about moving the cursor to it.

(VB.NET version of this Question: Keyboard shortcut for Jumping between "If/End If")

26条回答
何必那么认真
2楼-- · 2019-01-05 07:14

Note: It also works for #if / #elif / #endif matching. The caret must be on the #.

查看更多
手持菜刀,她持情操
3楼-- · 2019-01-05 07:14

On a Spanish keyboard it is CTRL + ¿ (or CTRL + ¡).

查看更多
成全新的幸福
4楼-- · 2019-01-05 07:14

On a Mac use command+shift+\.

Source: a comment on this answer: https://stackoverflow.com/a/37877082/3345085. Tested in Visual Studio Code version 1.10.2.

查看更多
手持菜刀,她持情操
5楼-- · 2019-01-05 07:15

On the Swiss-French keyboard : use CTRL + SHIFT + ^

查看更多
看我几分像从前
6楼-- · 2019-01-05 07:16

If for some reason this is NOT working for you, something may have messed up your keyboard bindings (it didn't work for me). You can re-enable the binding easy enough though - at least so I thought:

I tried this procedure:

  • Go to menu Tools -> Options -> Environment -> Keyboard
  • Scroll to, or search for the command Edit.GotoBrace
  • Assign the desired shortcut (mine was empty, so I put in CTRL    + ])
  • Be sure to click the "Assign Button"

I tried it, and it still didn't work. I restarted Visual Studio, and it still didn't work - well it ONLY worked for .cs files, but I need it to work for .vb files and text files, and...well ALL files!

查看更多
7楼-- · 2019-01-05 07:16

On my Slovenian keyboard it is ALT    + Đ

查看更多
登录 后发表回答