Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 for Haskell and I would like the same for F#. Is there a shortcut for this?

like image 908
Marko Grdinić Avatar asked May 14 '16 11:05

Marko Grdinić


People also ask

How do I go to a line in Visual Studio?

Go To Line dialog box To access this dialog box, open a document for editing, and then select Edit > Go To > Go To Line or press Ctrl+G.


1 Answers

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 (

Visual Studio 2017 Text Editor Options

like image 196
Lorien Brune Avatar answered Sep 21 '22 13:09

Lorien Brune