4

Windows 10, Emacs 25.1

If I want to find file in Helm I use command helm-find-files. Suppose I want to find in current folder all files with extenstion *.gradle.

Here result:

Find all files with extension gradle in current folder

OK. It's work.

But now I want to find all files with extension *.gradle not only in current folder, but also in all subfolders (recursive). How I can do this by command helm-find-files?

user8542613
  • 643
  • 6
  • 16
  • This should answer your question: https://emacs.stackexchange.com/questions/713/recursively-find-all-files-from-a-folder-containing-a-regexp-in-the-filename-us – mpm Sep 23 '17 at 13:20
  • 4
    Possible duplicate of [Recursively find all files from a folder containing a regexp in the filename, using helm](https://emacs.stackexchange.com/questions/713/recursively-find-all-files-from-a-folder-containing-a-regexp-in-the-filename-us) – mpm Sep 23 '17 at 13:20

3 Answers3

6

Just type TAB, input shell and RET use Find shell command to find files with filename recursively.

Or simply C-c /

muyinliu
  • 61
  • 1
  • 4
  • Strange name for an action. It probably should read, "Find files using `find`" or something. – x-yuri Oct 19 '21 at 08:19
4

Instead of doing this with helm-find-files, you could do it with helm-find. helm-find has the same fuzzy match but searches the directories recursively. It is smart in avoiding some not useful files / directories (like .git/ etc).

Just make sure you have find program installed on your machine. It comes by default on Unix based machines. On Windows, have git bash installed. Set Git bash to your default shell and then set the complete path of find to find-program variable in your .emacs file.

If you want to search from your default-directory. The standard shortcut is: C-x c /.

If you want to parameterize it with a different directory:

C-u C-x c /
<The directory to start search from> <RET>
<Your search string>

2

This will do what you want:

(defun my/helm-find-file-recursively ()  
  (interactive)
  "Recursively find files in glob manner, in the specified directory."
  (helm-find 'ask-for-dir))

(global-set-key (kbd "C-c o f") 'my/helm-find-file-recursively)
Muihlinn
  • 2,576
  • 1
  • 14
  • 22
Sami
  • 21
  • 2
  • Isn't this what is available out of the box? `C-u C-x c /`. See the [other answer](https://emacs.stackexchange.com/a/59704/7036) – x-yuri Jan 31 '22 at 19:22