Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select all text between quotes in VS Code?

I had to reinstall VS Code recently, I rember using Ctrl+W to kind of smart select everything between quotes but now what that command does is move me to another file/tab instead? Is there a way to do this in VS Code, Ctrl+W was just so easy to me, really helped with deleting or copying strings of text.

like image 654
gabogabans Avatar asked Sep 03 '25 01:09

gabogabans


2 Answers

As @Mark says in the comment, you can use the "Expand Selection" shortcut. The first press will select the word to the right of the cursor. The second press selects everything between the quotes.

The shortcut on Windows by default:
Shift + Alt +

And OS X:
Ctrl + Shift + +

like image 62
colinD Avatar answered Sep 05 '25 21:09

colinD


Try using the Quick and Simple Text Selection extension.

On a Mac, the extension's default shortcut is k, ". This is a chord, so:

  1. Press and k then let go
  2. Press "

This will select everything in double quotes.

If you want to select everything in single quotes use k, '

It also works for brackets and back ticks

  • k, [
  • k, {
  • k, (
  • k, <
  • k, `

On Windows, replace with Ctrl

like image 20
Fullchee Zhang Avatar answered Sep 05 '25 22:09

Fullchee Zhang