3

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!

  • Please leave a comment, at least, when you figure out what the problem was – Dmitry Jan 2 at 22:04
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.

| improve this answer | |
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

| improve this answer | |
0

I had the same problem and found out that company-begin-commands was screwed by some configuration I copied from sombody else. The value defines when company completion should be triggered. The default for the value is:

'(self-insert-command
  org-self-insert-command
  orgtbl-self-insert-command
  c-scope-operator
  c-electric-colon
  c-electric-lt-gt
  c-electric-slash)

Make sure this variable contains at least self-insert-command so that a popup can be triggered by normal typing.

| improve this answer | |

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.