Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a function in Emacs to search the filesystem for a file by its name?

Tags:

emacs

I want to open a file that is somewhere deep in my project tree. I know the name of the file, however I don't want to go searching the tree for it. I would like a way to enter just the file name, and have emacs search for me. I should also be able to enter the base directory I want to start the search from, and emacs should remember that for future searches.

like image 798
Vanson Samuel Avatar asked Jan 25 '26 05:01

Vanson Samuel


2 Answers

Sounds like you are looking for the equivalent of Textmate's Command-T functionality. The closest I have found for emacs is find-file-in-project. It can be bound to C-t or a similar key for convenience: (global-set-key "\C-t" 'ido-find-file-in-tag-files)

like image 163
Alex Avatar answered Jan 28 '26 02:01

Alex


M-x find-name-dired is the built-in solution for this. The default directory changes according to the current buffer, but the minibuffer history contains the previous selections.

like image 29
phils Avatar answered Jan 28 '26 02:01

phils



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!