6

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?

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

1 Answer 1

9

Try this:

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

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

Your Answer

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

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