我已设置cedet + auto complete并获得推荐系统。但是,无论何时显示建议的下拉菜单,我都希望在输入字符时过滤结果。 这是截图:
因此,当我输入pu
时,我希望下拉菜单包含push_back
之类的结果。我怎么做到的?
这是我的.emacs文件(相关部分):
;;; yasnippet
;;; should be loaded before auto complete so that they can work together
(require 'yasnippet)
(yas-global-mode 1)
(defun my:ac-c-header-init ()
(require 'auto-complete-c-headers)
(add-to-list 'ac-sources 'ac-source-c-headers)
(add-to-list 'achead:include-directories '"/usr/include/c++/4.8"))
(add-hook 'c++-mode-hook 'my:ac-c-header-init)
(add-hook 'c-mode-hook 'my:ac-c-header-init)
(add-to-list 'load-path "~/.emacs.d/")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(require 'auto-complete)
(ac-config-default)
(setq ac-auto-show-menu t)
(ac-flyspell-workaround)
;;cedet configuration
(semantic-mode 1)
(defun my:add-semantic-to-autocomplete ()
(add-to-list 'ac-sources 'ac-source-semantic))
(add-hook 'c-mode-common-hook 'my:add-semantic-to-autocomplete)
(global-ede-mode 1)
(global-semantic-idle-scheduler-mode 1)
(add-hook 'c-mode-hook 'my:add-semantic-to-autocomplete)
(add-hook 'c++-mode-hook 'my:add-semantic-to-autocomplete)
;; (defun my-semantic-hook ()
;; (imenu-add-to-menubar "TAGS"))
;; (add-hook 'semantic-init-hooks 'my-semantic-hook)
;(require 'semantic/ia)
;(require 'semantic/bovine/gcc)
(defun my-c-mode-cedet-hook ()
(add-to-list 'ac-sources 'ac-source-gtags)
(add-to-list 'ac-sources 'ac-source-semantic))
(add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook)
(add-hook 'c++-mode-common-hook 'my-c-mode-cedet-hook)
(semanticdb-enable-gnu-global-databases 'c-mode t)
(semanticdb-enable-gnu-global-databases 'c++-mode t)
答案 0 :(得分:0)
我想你可以使用ac-isearch
。
C-s
调用它。
M-x auto-complete
或自动启动)ac-isearch
(C-s
)