Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio - Find in files > not any node_modules folders

So in Visual Studios you can "Find in files" a string - I find this very useful to locate a file in which some markup or JS may be found, I use VS for my main code editor for Web development.

The problem is, most of my projects use node.js and node based build tools grunt/gulp etc. so I have a node_modules folder somewhere in my project that makes the FIND take for ever as there are thousands of files!!

How can I search in files and folders for a string BUT not in a node_modules directory.

In SublimeText2 you can remove a folder from the project without deleting it, this will stop a search looking in there...

A RegExp will be for the string not the filePath :(

like image 597
Will Hancock Avatar asked Jun 17 '14 13:06

Will Hancock


People also ask

How do I search all files in VS code?

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 search all folders in Visual Studio?

Press Ctrl-Shift-F to open "Find in Files". Enter your search term, then press Tab to forward the cursor to the "Look in" field.


1 Answers

Ok so I've tried this and it seems to work.

You can hide the node_modules folder (if they have a common root), by setting the Hidden attribute on the folder. As you say it fulfils your needs as per the question.

like image 122
alergy Avatar answered Nov 14 '22 22:11

alergy