2

When I write JavaScript code, company does not toggle when prefix is $, how to fix it?

(setq company-idle-delay 0)
(setq company-minimum-prefix-length 0)
(setq company-auto-complete t)
(setq company-require-match nil)
2
  • Which company backand are you using? ac-js2, company-tern or jquery-doc.el?
    – Jules
    Mar 16, 2016 at 15:53
  • it's up to the backend to determine when a prefix is valid. So as @Jules said, knowing what backend you are using makes a difference. Nov 28, 2017 at 22:48

1 Answer 1

0

You need company-dabbrev-code ; my config :

(use-package company
  :init
  (setq company-minimum-prefix-length 1
        company-selection-wrap-around t
        company-dabbrev-code-ignore-case t
        company-dabbrev-downcase nil
        company-dabbrev-ignore-case t
        company-backends
        '((company-dabbrev-code)
          (company-yasnippet
           company-capf           ; completion-at-point-functions
           company-files          ; files & directory
           company-keywords)))
  ;; (setq company-dabbrev-downcase nil)
  (eval-after-load 'company
    '(add-to-list 'company-backends '(company-dabbrev-code company-yasnippet company-abbrev company-dabbrev company-capf))))

Your Answer

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

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