2

I am using autocomplete-1.4.0 and yasnippet-0.8.1 with the following order and configuration in my .emacs file.

    ; === auto-complete ===
    (require 'auto-complete)
    (add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict") 
    (require 'auto-complete-config)
    (ac-config-default)

    ;; === yasnippet ===
    (require 'yasnippet)
    (yas-global-mode t)
    (setq yas-snippet-dirs
    '("~/.emacs.d/snippets/my-snippets"
      "~/.emacs.d/snippets/yasnippet-snippets"
      ))

However, I get no prompts from autocomplete for any of the existing snippets or for any of the new snippets that I create. Can someone help if I am doing something wrong here?

psykeedelik
  • 583
  • 1
  • 5
  • 6

1 Answers1

5

You should add the yasnippet ac-source. I have this in my init files:

(defun add-yasnippet-ac-sources ()
  (add-to-list 'ac-sources 'ac-source-yasnippet))

Then for every mode where I want the yasnippet source enabled, I add add-yasnippet-ac-sources to that mode hook:

(add-hook 'ruby-mode-hook 'add-yasnippet-ac-sources)
ale
  • 986
  • 1
  • 9
  • 14