12

I switched from sublime text to emacs a while back, and while I feel emacs is much nicer, its autocompletion is really lacking in responsiveness. I went and customized company so that it would try to complete after two characters had been typed and so the delay was only 0.1s, but it doesn't show up half the time and when it does, it's really not useful. Has anyone else had success in getting company to be as responsive as sublime/visual studio/eclipse? Any other IDE really.

m0meni
  • 743
  • 1
  • 6
  • 17

1 Answers1

14

I had also a bad experience with company at the beginning, but in my setup I just put these lines.

(setq company-dabbrev-downcase 0)
(setq company-idle-delay 0)

The first variable is used to skip the downcase that company does to the variables I autocomplete, the second one I think you already have.

(defun tab-indent-or-complete ()
  (interactive)
  (if (minibufferp)
      (minibuffer-complete)
    (if (or (not yas-minor-mode)
            (null (do-yas-expand)))
        (if (check-expansion)
            (company-complete-common)
          (indent-for-tab-command)))))

(global-set-key [backtab] 'tab-indent-or-complete)

Also these lines are useful to trigger the completion pressing the key you want.

Scott Weldon
  • 2,695
  • 1
  • 17
  • 31
user3347359
  • 327
  • 2
  • 7