Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search VSCode in subfolder, not the whole workspace

How can I search in one subfolder folder of my workspace only?

CTRL+SHIFT+F searches in the whole workspace, and since this is large I get way too many hits in unrelated folders and files.

like image 449
El Dude Avatar asked Apr 25 '19 20:04

El Dude


People also ask

Can a workspace folder have its own VSCode folder?

I want to support any folder in the tree being capable of being a workspace folder (which means it can have its own .vscode folder, though it's not necessary - the same today you can add another workspace folder without having to put a .vscode folder in it - though it'll cause it to be shown at the top level).

How can I search in one subfolder folder of my workspace?

How can I search in one subfolder folder of my workspace only? CTRL + SHIFT + F searches in the whole workspace, and since this is large I get way too many hits in unrelated folders and files. Show activity on this post. Right-click the folder in the Explorer and choose "Find in folder..."

How do I search for files in VS Code?

VS Code features like global search work across all folders and group the search results by folder. When you have a multi-root workspace open, you can choose to search in a single root folder by using the ./ syntax in the files to include box.

How do I create an untitled workspace in VS Code?

Unless you already have opened a .code-workspace file, the first time you add a second folder to a workspace, VS Code will automatically create an "untitled" workspace. In the background, VS Code automatically maintains a untitled.code-workspace file for you that contains all of the folders and workspace settings from your current session.


Video Answer


2 Answers

Two options:

  • Left-click the folder in the Explorer and use ALT+SHIFT+F
  • Right-click the folder in the Explorer and choose "Find in folder..."

This will give you a slightly changed search bar:

vscode search in folders sidebar

like image 153
Jeroen Avatar answered Oct 14 '22 10:10

Jeroen


The key combo is ALT+SHIFT+F

like image 35
p.campbell Avatar answered Oct 14 '22 10:10

p.campbell