Visual Studio - Is there a shortcut to insert parentheses around a selection?

前端 未结 3 1328
陌清茗
陌清茗 2021-02-19 03:55

I am playing with Atom and I really like how I can select an expression and press Shift+9 to insert ( and ) outside it. This is convenient

3条回答
  •  时光取名叫无心
    2021-02-19 04:14

    This is an in-built option in Visual Studio 2017. Go to Tools -> Options -> C / C++ -> Advanced, then navigate within the options dialog as shown on the screenshot below.

    Set the Enable Surround with Parentheses option to True.

    This works for C++, but the process ought to be similar for other languages.

    Once you click OK, you should be able to automatically insert parentheses around any selected text by typing only the first (

提交回复
热议问题