Kei*_*awa 5 emacs expand autocomplete list abbreviation
我想列出所有hippie-expand创建的项目,然后通过移动光标并点击RET来选择它们.有没有办法做到这一点?
这是我为此目的使用的:
(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)))
Run Code Online (Sandbox Code Playgroud)
必要的包是auto-complete、helm和ac-helm。所有这些都可以从包管理器中获得。
| 归档时间: |
|
| 查看次数: |
1049 次 |
| 最近记录: |