Emacsist RSS --- If never, make it ever: C-h C-h

Emacs and imenu

7052

这里 查看更多 Emacs 相关推荐文章最新 Emacs 圈的动态. 欢迎关注微信公众账号: Emacsist

If you haven’t used imenu, do this, load up some source code or an org-mode file, and:

  • M-x imenu
  • Return (to select the function)
  • Tab

Slick. The problem is you have to either use the mouse, or do a lot of typing with tab to get to the function or header you want.

Assuming you have use-package installed to both install and configure packages, put this in your .emacs file and smoke it:

(use-package idomenu
    :ensure t
    :bind ("C-c i" . idomenu))

Now, you have a key binding to search your functions using IDO’s sweet approach to text selection.

If you are mousy or don’t want the visual clutter associated with increasing your mini-buffer, I suggest usingimenu+ and its expansion on the standard menu support for imenu:

(use-package imenu+
    :ensure t
    :init (add-hook 'prog-mode-hook 'imenup-add-defs-to-menubar)
          (add-hook 'org-mode-hook  'imenup-add-defs-to-menubar))

Finally, if you are a Helm person, this approach creates a list of all functions/headers in a side buffer making it easier to see more options. Good for when you are looking at new source code:

(use-package helm
    :ensure t
    :bind (("C-c M-i" . helm-imenu)))

Next time, we should talk about tags…

原文出处: Howard Abrams
原文地址: http://www.howardism.org/Technical/Emacs/imenu.html
原文时间: 2016-01-06 16:00
本文地址: http://emacsist.com/10653
整理时间: 2016-01-07 23:35

本文由 Hick 整理,转载请保留以上信息;
COPYLEFTThe articles on this site come from Internet, thanks to all the original authors.
      If anything about COPYRIGHT, or LEFT, please contact Emacsist at gmail dot com .