My init.el loads company with (global-company-mode). I want to make an exception for Javascript buffers, and instead use auto-complete-mode for that mode.

Q: I am struggling to find a way to unhook company mode for only a particular mode. How can I do this?

  • Why do you want to, though? Both tern and ac-js2 have company-mode backends.
    – Dmitry
    Dec 1 '14 at 19:41
  • Ignorance, mostly. I don't have a good understanding of what a good emacs JS environment looks like.
    – Chris
    Dec 1 '14 at 20:36
  • 1
    this was quite helpful for setting up EIN since it does not offer a company backend
    – aiguofer
    Oct 6 '15 at 17:49

Try this:

(add-hook 'js-mode-hook 'my-javascript-hook)

(defun my-javascript-hook ()
  (company-mode -1)
  (auto-complete-mode 1))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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