Search better with your VS Code

Muhammad Yusuf
Nov 16, 2020

--

Photo by Forest Simon on Unsplash

Sometimes when you’re working with a big, long code file or just having one too many files to work with can be kind of frustrating if you want to find that specific part of the code. Thankfully VS Code allows you to quickly search over all files in the currently opened folder. You can start searching within your code by clicking on the search tab or pressing cmd/ctrl + F.

Search in A Single File

To search within a single file of code you can simply press:

cmd + F / ctrl + F

then you can navigate through all the matches found by pressing Enter/Return.

The cool thing with this feature is you can find a specific word by placing your cursor on the desired word right before you press the shortcut keys.

Even cooler, you can search in a range of selection by pressing the ‘Find in Selection’ button on the search panel.

Global Search Across Files

When you open a folder in VS Code, you can search over all files by selecting the search tab on the sidebar or by pressing:

cmd + shift + F

All matches will be grouped by files containing the query so you can filter out files you don’t need.

Or if you want to be more specific you can narrow it down by typing the file/folder name you want it to check, or specify which file/folder you want to exclude.

Here’s an in-depth documentation of searching in VS Code
https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace

--

--

Muhammad Yusuf
Muhammad Yusuf

No responses yet