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
(Cc Co) which can show function definitions in a different buffer. Close. But not exactly what I want.
Thanks!
Thanks to @jenesaisquoi's comment, I found helm-imenu-anywhere which does exactly what I want.
I override this key-binding Mr
(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 sr
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)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.