TransWikia.com

Helm: helm-find-files: how find files recursive?

Emacs Asked by user8542613 on December 9, 2021

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?

3 Answers

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>

Answered by Vasantha Ganesh on December 9, 2021

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)

Answered by Sami on December 9, 2021

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

Or simply C-c /

Answered by muyinliu on December 9, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP