Search particular text in all files having same name [Sublime text 3] - sublimetext3

I want to search for some text (foo) in all the files having same name in a directory (bar.yml).
I tried using */bar.yml, **/bar.yml, *bar.yml and a whole lot of other combinations in the Where part of find_all, but nothing seems to be working.
Is there a way to do this in Sublime Text 3 ?

Sublime looks for files inside a folder structure recursively, as far as I know.
Open the parent folder structure via File/Open Folder... and open the search dialog via Ctrl+Shift+F. Now add your search term to Find: and your filter bar.yml to Where:. That should do it.

Related

Sublime Text 3 - 'Find in Files' in Subdirectory/Subfolder of Project Source Tree

Background
I am working on a project that has a very large source tree. Since the source tree is large, the 'find in files' functionality of Sublime Text 3 takes quite some time to complete its search. I know that the symbols for which I am searching will only occur in certain (perhaps multiple) subdirectories of this source tree.
Question
Is there a way to restrict the 'find in files' functionality of Sublime Text 3 to search multiple (but not all) subdirectories of a project source tree?
Let's say you have a folder structure like this opened in Sublime Text:
root
other
bar
foo
target
bar
foo
We want to search in target.
Open the find panel with Ctrl + Shift + F.
In the Where field, add this filter:
target/
Search
The filter means "Search in any files that have a folder named target in the path.
You can be more specific by including more of the path, e.g. target/foo/. This will search in root/target/foo/, but not root/other/foo/.
Specify additional subdirectories by separating with commas, e.g. target/foo/,other/bar/.
Official Search and Replace documentation
You'll probably eventually also want to filter by file type. See this SO question for how to do that.

IntelliJ File mask not working on simple excluding file pattern! Why?

Follows this page https://www.jetbrains.com/help/pycharm/2016.1/find-and-replace-in-path.html?origin=old_help#mask , it should be able to exclude many files using "!" symbol in front of the regular pattern like: *.java, when doing text search inside IntelliJ projects.
On my project, when I fired Ctrl + Shift + F to do text search for string xyz. There's over 100+ results return in both *.ftl and *.java files. I tried to reduce the results on only ftl files by changing the "File mask(s)"-Option to "!*.java" . But it did not work! The result list is empty!
Googling on the excluding file pattern results in creating custom file filters for each particular search, which I don't want to maintain!
Do I miss something here or IntelliJ is just bad on this function (I'm using IntelliJ 15)? With Eclipse, the "File mask" was amazing!
You have to use
!*.java instead of !.java
As for IDEA 2019.1 Ultimate, it works for me(exclude with !*.yml or anything else).
If it does not in yours, as you only as .ftl file to exclude, why not add mask as *.java?
PS: what does not work is exclude some path, like "all files under out/ folder". With !out/* or anything ales it does not work.
Forget about File Mask and use Scope:
In Scope the options are unlimited where you can select folder include/exclude files or folders.
Excluding file paths in the Find in Path dialogue was not added until IntelliJ 2016.1 per this IntelliJ forum response.

Sublime Text "Find and Replace" doesn't work

Let's say I have this folder in a project: /xxx/yyy
If I look for a certain string inside folder /yyy, Sublime will show me the results, even if it has found it within a file inside a subfolder of /xxx/yyy, let's say, /xxx/yyy/zzz/whatever.cshtml (that means it's searching recursively)
BUT, If I look for the same string inside the folder /xxx (the parent folder), nothing happens and I get no results.
Why? Does it have a limit for searching recursively? Maybe it can't handle too many files?
OK, I realised now that it works, it's just too fricking slow. But the project is quite huge plus it's accessing files on another computer and Sublime Text for some reason doesn't give proper feedback about the search (e.g. takes +- a minute to show the message "Searching 38415 files for xxxx")

Ignore directories/files in Cmd-T opener in Sublime Text

I'm trying to open files using Cmd+T on Sublime Text. I'm sure I remember it taking it's settings from the "find in project" bottom bar (Cmd+^+F), but that doesn't seem to work.
To clarify, my find in project settings include -node_modules/ and when searching for strings I know are in files in that folder, it doesn't find them, but when I try to open readme.md using Cmd+T, it shows me all the readmes in my modules.

In Sublime Text, how do I find and replace the file name

Is there a way in sublime text where I can find a pattern and replace it with file names.
For example,
I have a bunch of file names that contain people.
I want to replace that with person.
in SideBarEnhancements there is an option to Mass Rename Selection... under Find Advanced to batch rename multiple files.
Menu: Find -> Find in Files...
Sublime is gonna open a new panel at the bottom, you just need to fill the fields. Inside the field Where, you can, for example, look up only for .txt files:
Find: People
Where: C:\Temp, *.txt
Replace: Person
No you cannot do a find and replace on a filename. Although there is a great package called SideBarEnhancements which would benefit from this feature. I will definitely submit a feature request.
Install the SideBarEnhancements plugin
Select the folder from side bar
Right click and open the context menu
From Find Advanced -> Mass Rename Selection... you can do this.

Resources