Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command-T for Emacs?

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!

like image 857
FullOfCaffeine Avatar asked Mar 26 '13 07:03

FullOfCaffeine


2 Answers

Any Emacs package that uses ido can do this, provided that ido-flex-match is non-nil. Helm-cmd-t deliberately doesn't support this kind of flexible matching.

You can get the behaviour you describe using find-file-in-repository with ido-flex-match set to 't.

like image 157
Wilfred Hughes Avatar answered Oct 15 '22 23:10

Wilfred Hughes


I've recently started using flx with ido-mode and projectile 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.

M-x package-install
flx

For more info see the flx project.

Here's a screengrab to illustrate...

flx fuzzy matching

like image 26
ocodo Avatar answered Oct 15 '22 23:10

ocodo