249

VSCode tips - How to select everything between brackets or quotes

 6 years ago
source link: https://ihatetomatoes.net/vscode-tips-select-everything-between-brackets-quotes/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

If you are looking for a quick way to select everything between matching brackets or quotes in VSCode, the following VSCode tips are for you.

Smart Select in VSCode

The build in keyboard shortcut for smartSelect is:

Shift + Alt + Right Arrow

This will grow your selection and smartly select everything between the matching brackets or quotes.

If you press this keyboard shortcut multiple times your selection will grow to the next matching brackets or tag.

If you want to shrink your selection use:

Shift + Alt + Left Arrow

Quick and Simple Text Selection

The build in keyboard shortcuts are great but if you want even more control over your selection checkout the Quick and Simple Text Selection extension by David Bankier.

What I like the most about this extension is the ability to choose everything inside of a single quotes, double quotes, back ticks, brackets, square brackets or tag with a single keyboard shortcut.

What can be done by repeating the build in shortcut can be done with a single keyboard shortcut using this extension.

This extension lets you to:

  • Ctrl + K ' select everything between single quotes
  • Ctrl + K " select everything between double quotes
  • Ctrl + K ` select everything between back ticks
  • Ctrl + K ( select everything inside parenthesis
  • Ctrl + K ) select everything inside parenthesis and include them
  • Ctrl + K [ or ] select everything between square brackets and include them
  • Ctrl + K { or } select everything between curly braces and include them
  • Ctrl + K < or > select everything between angle brackets and include them

Install Extension

Conclusion

Hope you have found this VSCode tip useful.

Do you use any other extensions that lets you to quickly select code in VSCode?

Let me know in the comments below.

Related VSCode Tips

Like What You're Reading?

Sign up to receive my future tutorials and demos straight to your inbox.

No spam, Unsubscribe at any time.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK