Skip to content

Instantly share code, notes, and snippets.

Last active April 24, 2019 06:31
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Yasnippet + company + helm
;; Add yasnippet support for all company backends
(defvar company-mode/enable-yas t
"Enable yasnippet for all backends.")
(defun company-mode/backend-with-yas (backend)
(if (or (not company-mode/enable-yas) (and (listp backend) (member 'company-yasnippet backend)))
(append (if (consp backend) backend (list backend))
'(:with company-yasnippet))))
(setq company-backends (mapcar #'company-mode/backend-with-yas company-backends))
;; helm-company choose from company completions with C-:
(with-eval-after-load 'company
(define-key company-mode-map (kbd "C-:") 'helm-company)
(define-key company-active-map (kbd "C-:") 'helm-company))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment