This is something that's been bothering me for a while. I think I've configured company-mode
backends wrong as I'm also getting company backends when inside comments.
Here
is my company-mode
config file.
And here is an example of how I enable company-mode
for specific major modes using a local variable for company-backends
and adding that to the major mode hook. Like so:-
(defun my-racer-mode-hook ()
(set (make-local-variable 'company-backends)
'((company-capf company-files company-yasnippet))))
(add-hook 'racer-mode-hook 'my-racer-mode-hook)
I configure other major modes very similarly to the snippet above. But, I feel I did a mistake somewhere that's making company-yasnippet
to pop up in the comments also. Can someone please point out where I did wrong ?
EDIT: I get completion from all backends inside the comments, not just company-yasnippet
. Sorry for the confusion.
:with
beforecompany-yasnippet
.:with
still gets me completions in the comments