Last active
April 24, 2019 06:31
-
-
Save fletch/cefeb0ebe01552081d10 to your computer and use it in GitHub Desktop.
Yasnippet + company + helm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; http://emacs.stackexchange.com/questions/10431/get-company-to-show-suggestions-for-yasnippet-names | |
;; Add yasnippet support for all company backends | |
;; https://github.com/syl20bnr/spacemacs/pull/179 | |
(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))) | |
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