开发者

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

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.


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)


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.


I happen to like the ifind.el package which can be downloaded from the emacswiki here.


In Icicles you can find files by matching not just the relative file name but any parts of the path. You can use substring, regexp, and fuzzy matching. You can AND together multiple search patterns (progressive completion). See multi-command icicle-locate-file.

http://www.emacswiki.org/emacs/Icicles_-_File-Name_Input

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜