editor/snippets: don't auto-enable yas-global-mode

This commit is contained in:
Henrik Lissner 2019-07-22 00:35:24 +02:00
parent 567d0b6d16
commit 33c220902e
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -65,5 +65,15 @@
[remap yas-visit-snippet-file] #'+snippets/edit))
;;;###package auto-yasnippet
(setq aya-persist-snippets-dir (concat doom-etc-dir "auto-snippets/"))
(def-package! auto-yasnippet
:defer t
:init (setq aya-persist-snippets-dir (concat doom-etc-dir "auto-snippets/"))
:config
(def-advice! +snippets-inhibit-yas-global-mode (orig-fn &rest args)
"auto-yasnippet enables `yas-global-mode'. This is obnoxious for folks like
us who use yas-minor-mode and enable yasnippet more selectively. This advice
swaps `yas-global-mode' with `yas-minor-mode'."
:around '(aya-expand aya-open-line)
(cl-letf (((symbol-function #'yas-global-mode) #'yas-minor-mode)
(yas-global-mode yas-minor-mode))
(apply orig-fn args))))