Earn More by Sharing What You Love
Do you create content for developers working with .NET, C#, Java, Python, or Node.js? Turn your expertise into extra income!

Tim Corey
4m 39s
Writing clean, error-free code often comes down to how well your text editor handles the little things. Whether you're working in Visual Studio or VS Code, one key improvement is the ability to close all brackets and quotes automatically. In his video on "Visual Studio Update: Automatically Close Brackets and Quotes", Tim Corey walks through a newly introduced setting in Visual Studio 2022 version 17.9 that simplifies this exact task.
This article follows Tim's step-by-step breakdown, explaining how to enable the feature, use it efficiently, and improve editing speed when working with code blocks, brackets, and quotes.
Tim begins the video by pointing out a common editing task in any code editor: wrapping text or code in quotes, parentheses, or curly braces. Whether you're formatting source code, isolating logic in a function, or preparing data for output, surrounding text properly is essential.
In Visual Studio 2022 v17.9, this task just got easier. With a simple change in settings, you can automatically wrap selected lines, variables, or HTML-like text in brackets or quotes by just typing the opening symbol. You don't need to press a second key, use the mouse, or search the command palette - the text editor now handles it for you.
To demonstrate the feature in context, Tim uses a small example involving math operations inside a code block. The logic includes a simple expression: 5 * 4 + 3. Tim runs the file to show the output - 23. As he explains, this is due to the order of operations.
Next, Tim points out another part of the source code where a message is printed, but instead of printing the variable value, it just prints the variable name. He plans to update this part to better show the new bracket and quote behavior.
This is where the tutorial gets practical. Tim explains that the automatically close brackets feature is disabled by default, so you have to enable it manually.
Here's how you do it:
This setting changes how Visual Studio behaves when typing symbols like (, {, ", ', and others. Tim emphasizes that Microsoft has left this feature off by default so as not to disrupt existing editing workflows. But once enabled, it becomes a powerful way to speed up coding.
With the feature enabled, Tim demonstrates how to restructure code more efficiently. He selects 4 + 3 from the expression and types the open parenthesis (. The editor immediately surrounds the selection with (4 + 3) - without needing to type the closing bracket.
This changes the result of the equation from 23 to 35, because now the context of the expression shifts due to parentheses. Tim uses this to explain how the cursor position, keyboard input, and smart editing features can dynamically enhance the coding experience.
He points out that this works not just with parentheses, but with a variety of brackets, making it ideal for managing complex code blocks, logic in functions, or even tags in HTML documents.
Next, Tim expands the demo with a variety of wrapping examples:
{result} - perfect for string interpolation or data placeholders.Tim even shows wrapping text with square brackets [], angle brackets <>, and curly braces {}. These tools are useful whether you're working with C#, HTML, JSON, or even writing comments or custom regions in code.
If you've ever wished for a quicker way to insert paired symbols, especially across multiple lines, this feature brings your editor one step closer to an intuitive writing assistant.
Tim concludes by rerunning the code. With all changes made, the output now says:
"The answer to the 'math' problem is 35"
Thanks to Visual Studio's ability to automatically surround selected text, Tim's small code adjustments were faster, easier, and more reliable. He notes that this enhancement turns Visual Studio into an even better text editor - something closer to the flexibility of VS Code with keyboard shortcut support and command-like automation.
While Tim's demo is in Visual Studio, users of Visual Studio Code (VS Code) can achieve similar results using features like editor.autoSurround in the settings or by assigning custom keyboard shortcuts via the command palette.
Though Tim's tutorial is focused on Windows, these concepts apply broadly. If you're using Visual Studio Code on Mac or Linux, you can:
These commands allow you to toggle and fold parts of your code or adjust brackets and quotes automatically - streamlining your editing workflow no matter the platform.
Tim Corey's video provides a focused tutorial on how to improve coding speed in Visual Studio by enabling a single setting: automatically surround selections when typing quotes or brackets. Whether you're working in VS Code or Visual Studio, learning how to quickly close all brackets, wrap lines, or structure logic without breaking focus from the keyboard is a skill worth mastering.
For developers looking to write clean, structured source code quickly - without reaching for the mouse - this is a powerful feature to activate. And if you're someone who uses VS Code, consider exploring its similar auto-wrapping and folding capabilities via the command palette and keyboard shortcuts.
Do check out Tim Corey's YouTube channel for more practical tutorials and updates on Visual Studio, .NET development, and productivity tips for developers.
Do you create content for developers working with .NET, C#, Java, Python, or Node.js? Turn your expertise into extra income!
Join our newsletter, you’ll get exclusive access on article updates. We value your privacy