I'm trying to configure company-mode to activate in all buffers, with the appropriate back-ends depending on file-type. To that end, I've added the following to my init.el file. However, regardless of which file-type I open, company-mode does not automatically activate. Help in sorting this out is appreciated.

;; Enable global company mode
(require 'company)
(add-hook 'after-init-hook 'global-company-mode)
(setq company-idle-delay 0.1)
(setq company-minimum-prefix-length 1)
(setq company-backends '((company-capf company-files company-elisp company-inf-ruby company-anaconda company-go company-irony company-clang company-cmake company-css company-yasnippet) (company-dabbrev company-dabbrev-code)))

Complete init.el posted here: http://pastebin.com/eyvvzUPW

  • Your config seems OK, and can evaluate this in a scratch buffer and start getting auto-completions. Is it possible some other config is interfering -- can you start emacs -Q and then evaluate this and see if it works? You might also try a much setting for company-backends and see if you can get it working with one or two backends first. – glucas Jan 18 '17 at 21:01
  • @glucas I've added the complete init.el file for reference. Yes, I'm able to run emacs -Q and then execute the above included configuration successfully. Do you notice anything off in the complete init.el? Do you have any suggestions for debugging the init.el file? – Ari Jan 19 '17 at 16:48
  • Recursively bisect your init file to find the problem. Do a quick search on this site for "bisect init", and a bunch of answers will pop up to explain how to do that. – Dan Jan 19 '17 at 16:54
  • You can use (global-company-mode) for activating company on all buffers. I recommend customize-variable instead of those (setq …) – Felipe Lema Jan 19 '17 at 19:11
  • Nothing jumps out at me. You should check if your custom.el is setting any additional company- variables. As Dan noted, the way to debug is to bisect your init file. – glucas Jan 19 '17 at 21:41

Your Answer

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

Browse other questions tagged or ask your own question.