I've set up auto-complete on emacs to display completion candidates, and it seems to be working well so far. I'm finding the constant display (and changes in display) distracting when I type, and I would like to get auto-complete to show completion candidates only when I press a key, preferably the tab key.

Can this be done? Here's my current configuration (including yasnippet, which I want to respond to the tab keypress first):

(use-package yasnippet
  :ensure t
    (yas-global-mode 1)
  :pin gnu

(use-package auto-complete
  :ensure t
    (require 'auto-complete-config)
    (add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
    (ac-set-trigger-key "TAB")
    (ac-set-trigger-key "<tab>"))
  :pin melpa

This shows completion candidates continuously.

1 Answer 1

(setq ac-auto-start nil)


Specify how completion will be started. t means always starting completion automatically. nil means never started automatically. An integer means completion will not be started until the value is more than a length of the completion target string.

It's described in the Auto-Complete User Manual.

  • Thanks -- it works. And thanks for the pointer to the manual. Commented Jun 3, 2019 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.