Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

completion candidates #2

Open
ghost opened this issue Sep 2, 2015 · 2 comments
Open

completion candidates #2

ghost opened this issue Sep 2, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 2, 2015

Thanks for your work!

From the readme:

When you edit your .html(.jade, etc) file exec M-x ac-html-bootstrap+ or M-x company-web-bootstrap+ to enable twitter bootstrap completion

Is it feasible have the completions without the above procedure, ie pop up automatically?

I tried making a group:
(add-hook 'web-mode-hook
(lambda ()
(set (make-local-variable 'company-backends)
'((company-web-html company-web-bootstrap+)))))
but it didn't work:

Company back-end ’company-web-bootstrap+’ could not be initialized:
Wrong number of arguments: (lambda nil "Enable bootstrap ac-html completio
n" (interactive) (make-local-variable (quote web-completion-data-sources))
(if (assoc "Bootstrap" web-completion-data-sources) nil (setq web-complet
ion-data-sources (cons (cons "Bootstrap" (quote ac-html-bootstrap-source-d
ir)) web-completion-data-sources)))), 1

@osv
Copy link
Owner

osv commented Sep 3, 2015

Instead

'((company-web-html company-web-bootstrap+)))))

try

(company-web-bootstrap+)

Example from my config:

(defun my-web-mode-hook ()
  "Hook for Web mode."
  (setq web-mode-markup-indent-offset 2)
  (setq web-mode-css-indent-offset 2)
  (setq web-mode-code-indent-offset 2)
  (setq web-mode-ac-sources-alist
        '(("css" . (
                    ac-source-css-property
                    ac-source-dictionary
                    ac-source-words-in-same-mode-buffers
                  ))
          ("html" . (
             ac-source-html-attribute-value
                     ac-source-html-tag
                     ac-source-html-attribute
             ac-source-filename
                     ac-source-yasnippet
                     ))))
  (set (make-local-variable 'company-backends) '(company-web-html company-yasnippet company-files))
  (company-web-bootstrap+) ; <--------------------- here
  (setq web-mode-enable-auto-quoting nil))

(add-hook 'web-mode-hook 'my-web-mode-hook)

@osv
Copy link
Owner

osv commented Sep 3, 2015

Config above is configured to make work wit ac-html, however I don't use it now, so example config may look:

(defun my-web-mode-hook ()
  "Hook for Web mode."
  (setq web-mode-markup-indent-offset 2)
  (setq web-mode-css-indent-offset 2)
  (setq web-mode-code-indent-offset 2)
  (set (make-local-variable 'company-backends) '(company-web-html company-yasnippet company-files))
  (company-web-bootstrap+) ; <--------------------- here
  (setq web-mode-enable-auto-quoting nil))

(add-hook 'web-mode-hook 'my-web-mode-hook)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant