About auto complete and yasnippet in emacs

后端 未结 1 631
迷失自我
迷失自我 2021-01-05 00:43

I\'m using auto-complete and yasnippet in Emacs and I am confused by their settings. I placed the following code in my .emacs:



        
相关标签:
1条回答
  • 2021-01-05 01:16

    ac-config-default installs hooks to setup sensible default ac-sources values. These hooks (especially ac-common-setup) might interfere with your settings.

    You can check this by looking at the actual value of ac-sources (C-h vac-sources) in a js-mode buffer to see if it has been modified by comparison to your custom value.

    If this is the case, I see two solutions:

    • stop using ac-config-default and specifiy all autocomplete settings,
    • advise the faulty hook to put ac-source-yasnippet at the beginning of ac-sources after it has run. Assuming ac-common-setup is indeed the troublemaker, this would look like:
    (defadvice ac-common-setup (after give-yasnippet-highest-priority activate)
      (setq ac-sources (delq 'ac-source-yasnippet ac-sources))
      (add-to-list 'ac-sources 'ac-source-yasnippet))
    
    0 讨论(0)
提交回复
热议问题