2

So I have installed company mode with the backend company-gtags. This is what my init file looks like for company.

;; == company-mode ==
(use-package company
  :diminish company-mode
  :ensure t
  :init (add-hook 'after-init-hook 'global-company-mode)
  :config
  (setq company-idle-delay              0.1
        company-minimum-prefix-length   2
        company-show-numbers            t
        company-tooltip-limit           20
        company-dabbrev-downcase        nil
        company-backends                '((company-gtags))
      )
  :bind ("s-;" . company-complete-common)
  )

When I type part of a variable/function, and wait for company to autocomplete, nothing happens. Then when I press s-; I see the popup with completions.

However, I would like for company to start the completion automatically and I am not sure what I am missing.

Thanks!

1

The configuration looks all right. There could be something wrong with your gtags setting.

For what it's worth, I think you should use company-complete instead.

company-complete:

Insert the common part of all candidates or the current selection. The first time this is called, the common part is inserted, the second time, or when the selection has been changed, the selected candidate is inserted.

0

company should work out of box if you:

  • build tags using GNU Global

  • set up environment variable GTAGSLIBPATH

See https://www.gnu.org/software/global/manual/global.html

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.