Search in all files in a project in Sublime Text 3


Sublimetext Problem Overview

Is there a way to search for a string in all files inside a project in Sublime Text 3? The string is not a method.

Sublimetext Solutions

Solution 1 - Sublimetext

You can search a directory using FindFind in files. This also includes all opened tabs.

The keyboard shortcut is Ctrl+F on non-Mac (regular) keyboards, and +F on a Mac.

You'll be presented with three boxes: Find, Where and Replace. It's a regular Find/Find-replace search where Where specifies a file or directory to search. I for example often use a file name or . for searching the current directory. There are also a few special constructs that can be used within the Where field:

<project>,<current file>,<open files>,<open folders>,-*.doc,*.txt

Note that these are not placeholders, you type these verbatim. Most of them are self-explanatory (e.g. -*.doc excludes files with a .doc extension).

Pressing the ... to the right will present you with all available options.

After searching you'll be presented with a Find results page with all of your matching results. To jump to specific lines and files from it you simply double-click on a line.

Solution 2 - Sublimetext

You can put <project> in "Where:" box to search from the current Sublime project from the Find in Files menu.

This is more useful than searching from the root folder for when your project is including or excluding particular folders or file extensions.

Solution 3 - Sublimetext


Use the Search all shortcut: Ctrl+Shift+F, then select the folder in the "Where:" box below. (And for Mac, it's +Shift+F).

If the root directory for the project is proj, with subdirectories src and aux and you want to search in all subfolders, use the proj folder. To restrict the search to only the src folder, use proj/src in the "Where: " box.

Solution 4 - Sublimetext

Right click on your root folder, find in folder.

enter image description here

Solution 5 - Sublimetext

Here's the easiest way : File -> Find in files

enter image description here


All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionIvanView Question on Stackoverflow
Solution 1 - SublimetextkeyserView Answer on Stackoverflow
Solution 2 - SublimetextEfreetoView Answer on Stackoverflow
Solution 3 - SublimetextIvanView Answer on Stackoverflow
Solution 4 - Sublimetextgarg10mayView Answer on Stackoverflow
Solution 5 - SublimetextMohammad HeydariView Answer on Stackoverflow