Created
June 15, 2017 23:45
-
-
Save sebastiencs/a16ea58b2d23e2ea52f62fcce70f4073 to your computer and use it in GitHub Desktop.
company with yasnippet
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
;; With this code, yasnippet will expand the snippet if company didn't complete the word | |
;; replace company-complete-common with company-complete if you're using it | |
(advice-add 'company-complete-common :before (lambda () (setq my-company-point (point)))) | |
(advice-add 'company-complete-common :after (lambda () | |
(when (equal my-company-point (point)) | |
(yas-expand)))) |
This actually works. Wow -- thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To avoid the "assignment to free variable" warning, one could add
(defvar my-company-point nil)
above the snippet.