Get "PHP 8 in a Nuthshell" (Soon includes PHP 8.4)
Amit Merchant

Amit Merchant

A blog on PHP, JavaScript, and more

The new Quick Search Text in VS Code is Gooood!

When you want to search for something across your project in VS Code, the usual way is to open the Search panel and type in the search term, and VS Code will show all the instances of the term in your project.

You can then work your way through the list of results to find the one you want. Pretty standard stuff. But as you can tell, it involves opening up your left sidebar (or right sidebar) and then proceeding with the search.

Well, VS Code tries to fix this in a recent release with something called the Quick Search Text.

Essentially, this is an experimental feature that, when enabled, lets you search project-wide without having to open the left sidebar.

To get started, open the Keyboard Shortcuts panel and Search for “quicksearchtext”. This will show you the command to invoke this feature. You can go ahead and assign a shortcut to this command. I used Option + F for this but you can use whatever is convenient for you.

Quick Search Text Keyboard Shortcut

Once done, you can now invoke the Quick Search Text feature by the shortcut you assigned and start searching using the command palette like so.

As you can tell, once the command palette is opened, you need to need to start searching using % as a prefix to your search term. VS Code will show all the matching instances in the project’s files and you can cycle through them using the arrow keys.

Pretty neat, right?

I think I’m gonna try using this more often than the traditional search and see how it goes.

What do you think? Let me know in the comments!

Like this article?

Buy me a coffee

👋 Hi there! I'm Amit. I write articles about all things web development. You can become a sponsor on my blog to help me continue my writing journey and get your brand in front of thousands of eyes.

Comments?