I'm a long time Emacs user, but partially switched to MacVim 2 years ago, and have been using it for all my programming work (still using Emacs for other stuff). I decided to switch back to Emacs now, mainly because of the awesome evil-mode
. I'm quite happy, but I still haven't found something as good and simple as the Vim Command-T plugin.
The main problem with the Emacs alternatives is that they are either too complicated and or slow.
The closest thing to Command-T is helm
/helm-cmd-t
, but it doesn't quite work like it.
Let's say you have two paths:
app/controllers/admin/feedback_controller.rb
app/controllers/fee_controller.rb
In Vim's Command-T, you can write:
app/controllers/fe
And it will match both paths.
With helm-cmd-t
, if I write app/controllers/fee
, it will only match fee_controller
. If I want to match both, I have to use a regexp, as in app/controllers/.*
, which is not that bad, but requires more keystrokes.
Any suggestions appreciated!
Did you try LustyExplorer? It's based on the Vim plugin with the same name.
Also, it looks like you are not using Command-T to the best of its capabilities:
acfe
should be enough for it to match those two files. What you do is not particularly better than:e app/con*/**/fe<Tab>
.I've once run across gpicker which advertises speed as one of its advantages over Ido and other "native" elisp packages. Never got to try it out on real-world projects though, but it might work for you.
I've recently started using
flx
withido-mode
andprojectile
it has exceptionally good, ranked fuzzy matching and has a very similar feel to CtrlP and CmdT for Vim.It can be installed via MELPA.
For more info see the flx project.
Here's a screengrab to illustrate...
Give textmate.el a try :) https://github.com/defunkt/textmate.el
You'll just have to use "Command+T" instead of "Ctrl+P" :)
Long story short - there's nothing quite like command-T for Emacs. Best options are gpicker or Peepcode's peepopen, but they are external applications, and I find them to be distracting after using command-T for so long. I'll stick to MacVim for now, only because of command-T, but might look into implementing something that behaves just like command-T as an exercise.
Thank you all for the answers and comments!
Here it is, but required helm to be installed first: https://github.com/emacs-helm/helm-cmd-t
EDIT: See my Helm guide. Read why it is powerful. See
helm
withprojectile
in action in that section.With fuzzy searcher like Ido + flx or the like in Vim, you have to type thing in order. With Helm, you can perform out of order matching.I called it out of order because whether I enter "main.c x86" or "x86 main.c", I get the same set of results for the either query. But it also makes sense to call it multi-steps search. Without having to enter the search strings (called "patterns", which are actually regexp) in an orderly fashion, Helm gives me greater freedom: I can enter the thing I wanted first in my mind without having to remember its complex path; if there are many candidates from the target I wanted, I narrow it down further with more details (patterns).
The above example to illustrate the two cases from the advantage above:
As you can see, the Linux kernel source tree contains more than 40kfiles, and I narrowed it down to a few files immediately.
Visual Studio also implements this mechanism in their project search, but it's not generic as Helm. In Helm, you can reuse the same Helm interface for many other things; for example, see
helm-semantic-or-imenu
. You have something like an outline tree, but you can interactively and incrementally narrow to the candidates you want with a few simple patterns.Finally, fyi,
flx
author - Le Wang - is using Helm.