6

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

4

3 回答 3

2

Here's what I'm using for this purpose:

(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)))

Necessary packages are auto-complete, helm, and ac-helm. All of them you can get from the package manager.

于 2014-01-09T13:20:38.953 回答
2

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

于 2015-03-27T13:44:37.713 回答
1

不久前,我为类似问题写了以下答案。它使用 ido 接口进行选择,但它应该可以直接适应另一个选择接口。

如何配置emacs让它像vim一样自动完成路径?

于 2014-01-09T14:02:47.177 回答