8

In emacs with helm, I can C-x C-f find file. After type part of the folder name, helm find the right folder. At this point, I can

  1. hit Enter to enter Dired mode. and C-s to search a second level folder...
  2. or hit tab to complete the folder name, and continue type part of the second foler name.

Is there a way to find-file quicker like in the sublime text editor? (fuzzy search both the file names and folder names).

10

You can use Helm Projectile to jump around files in projects easily. There are some demos at the top of my guide. You can even treat any directory as a project and jump to anywhere by making an empty .projectile file in that directory, if your project is not directly supported by Projectile. Projectile not only provides jumping to files/directories from anywhere at anytime, but you can also jump to any file at cursor, in any file without merely the filename.

For jumping to find, use helm-projectile-find-file, bound to C-c p f by default.

For jumping to directory, use helm-projectile-dir, bound to C-c p d by default.

To switch between recognized projects, use helm-projectile-projects, bound to C-c p p.

Projectile can possibly be used in a directory with a large number of files (i.e. your home directory with something like 80k-100k files) by enable caching:

(setq projectile-enable-caching t)

Depend on your hard drive, the first time starting helm-projectile-find-file may take a while to retrieve the file list and block Emacs. But this only happens once. Subsequent access you get the file list instantly until you invalidate the cache.

Note that you can fuzzy match without entering a space between search terms. The difference is that, if you add a space, Helm reverts to its old matching behavior: exact match with regex. Without a space, Helm uses the fuzzy matching similar to the one you see in Sublime Text.

  • Wow! This is really life-changing! Thank you very much! – Nick Dec 25 '14 at 14:38
  • @Nick I updated the answer. – Tu Do Dec 25 '14 at 14:41
  • Thank you for your reminding. I think add cashing to your answer would make more people appreciate projectile. (I added a .projectile file to my home directory, which makes everything slow down. I read your guide and add (setq projectile-enable-caching t) to my setup, everything is magically fast! I think others would tend to do it as well.) – Nick Dec 25 '14 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.