如何显示hippie-expand命令在Emacs中创建的所有可能的完成?

时间:2014-01-09 13:13:34

标签: list emacs autocomplete expand abbreviation

我想列出hippie-expand创建的所有项目,然后通过移动光标并点击RET来选择它们。有没有办法做到这一点?

3 个答案:

答案 0 :(得分:2)

以下是我为此目的使用的内容:

(global-set-key (kbd "M-i") 'complete-with-helm)
(require 'ac-helm)
(require 'auto-complete-config)
(ac-config-default)
(defun ac-complete-with-helm-auto ()
  "Select `auto-complete' candidates by `helm'.
It is useful to narrow candidates."
  (interactive)
  (let ((c (ac-candidates)))
    (if (= (length c) 1)
        (ac-expand)
      (when ac-completing
        (with-helm-show-completion ac-point ac-last-point
          (helm :sources 'helm-source-auto-complete-candidates
                :buffer  "*helm auto-complete*"))))))
(defun complete-with-helm ()
  (interactive)
  (ignore-errors
    (call-interactively 'auto-complete)
    (call-interactively 'ac-complete-with-helm-auto)))

必要的软件包是auto-completehelmac-helm。 所有这些都可以从包管理器中获得。

答案 1 :(得分:2)

使用公司模式。所有UI问题已在公司模式中解决

答案 2 :(得分:1)

我刚才在类似问题上写了以下答案。它使用ido接口进行选择,但它应该很容易适应另一个选择界面。

How to configure emacs to have it complete the path automatically like vim?