user10375
user10375

Reputation: 645

Emacs list function definitions popup like Sublime CMD + R

In Sublime Text (Mac OS X), you can do CMD + R shortcut to list function definitions in a popup. When you type function names, it does fuzzy matching to show matches. Press enter and go to the definition. I find it very handy.

In Emacs, is there something like that?

I'm using elpy for writing Python and I found elpy-occur-definitions (C-c C-o) which can show function definitions in a different buffer. Close. But not exactly what I want.

Thanks!

Upvotes: 1

Views: 463

Answers (1)

user10375
user10375

Reputation: 645

Thanks to @jenesaisquoi's comment, I found helm-imenu-anywhere which does exactly what I want.

I override this key-binding M-r (since I don't use the navigation function that often) which is also very close to Cmd-R.

(global-set-key (kbd "M-r") 'helm-imenu-anywhere)

UPDATE:

If you are on Mac OS X and want to use the same CMD + R to do this, you ca bind the key to s-r instead:

(global-set-key (kbd "s-r") 'helm-imenu-anywhere)

UPDATE 2:

I found that, to list functions in current buffer (versus out of all files), the best trick is helm-semantic-or-imenu. So my ultimate setup is

(global-set-key (kbd "s-r") 'helm-semantic-or-imenu)
(global-set-key (kbd "s-o") 'helm-imenu-anywhere)

Upvotes: 3

Related Questions