Reputation: 53
I've recently switched from using Eclipse to emacs. I'm trying to find a way to emulate eclipse's Ctrl-Shft-r functionality which lets you type in a file name and it begins showing all files in the current workspace that begin with the string you are typing.
C-x C-f seems to handle just tab-completion in the current directory, whereas Eclipse's functionality looked through all sub-directories to find matching files.
I'm looking for something (maybe there's a plugin that does this) that allows you to type the name of folder to look in, and then a partial file and returns back the results in a buffer. Possibly that uses auto-complete to list off matching files with their full paths.
Upvotes: 1
Views: 348
Reputation: 64
You're looking for projectile which indexes your project's files. I used it for a while but have recently switched to using helm-recentf
(global-set-key "\C-x\ \C-r" 'helm-recentf)
I have recent files set to a large number. Pretty much anything I've ever opened is a few keystrokes away. This even doubles up as a handy way to switch buffers.
(require 'recentf)
(setq recentf-auto-cleanup 'never)
(recentf-mode 1)
(setq recentf-max-saved-items 200)
Upvotes: 1
Reputation: 2518
First of all, steer clear of vanilla find-file
function (that's the interactive function that is run when you hit C-x C-f
). It is very limited, it forces you to hit TAB
all the time, and the first thing most people do when switching to emacs is replace find-file
with something more powefull.
There're a number of alternatives. ido-mode is one, helm is another. The former is light-weight, fast and comes built-in with emacs. The latter is immensely powerful and strives to be fast, too.
Second of all, there're two ways a recursive file search can usually be done:
For directory search, ido-find-file
and helm-find-file
are both viable options. Ido does its search automatically when you pause typing; helm uses (C-u) M-g s
to activate grep. See this SO question for more info.
For project search, you need a library to manage your projects. Projectile is great for that. Set it up and use C-c p f
or C-c p F
to list files in current or all of your projects, respectively. Oh, and projectile uses ido by default, but there is helm support, too.
Upvotes: 3