Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to search only in currently open files in vscode?

I usually work on larger projects with many files that would contain the search query. So I would open the files I want to modify and do a find/replace across all currently opened files. Can this be done in vs code?

The feature I'm looking for is implemented in Notepad++, but I'd prefer not to have to switch editors for this task.

like image 931
sneusse Avatar asked Feb 02 '17 20:02

sneusse


People also ask

How do I search for open files in VS Code?

To perform a search across all your open files, use the following shortcuts. For Mac use “Command + Shift + F”. For Windows and all other operating systems use “Ctrl + Shift + F”.

How do I search open files?

Search File Explorer: Open File Explorer from the taskbar or select and hold the Start menu (or right-click), select File Explorer , then select a search location: To quickly find relevant files from your PC and the cloud, search from Home. To find files stored inside a folder, search from a folder like Downloads.

How do you search within a file in VS Code?

Search across files# VS Code allows you to quickly search over all files in the currently opened folder. Press Ctrl+Shift+F and enter your search term. Search results are grouped into files containing the search term, with an indication of the hits in each file and its location.

How do I filter search in VS Code?

Select text that you want to filter. Press Ctrl+K Ctrl+F ( ⌘K ⌘F on macOS). Alternatively, press F1 and run the command named Filter Text Inplace .


2 Answers

For me somehow it works just by typing ./ in the files to exclude field.

Here

like image 119
Jmena Avatar answered Sep 21 '22 01:09

Jmena


"Search: target particular set of files #20530" located here: https://github.com/Microsoft/vscode/issues/20530

Is tracking a search "scope" such as "all open files".

like image 22
Kevin Avatar answered Sep 23 '22 01:09

Kevin