From 33c220902e68e6b3de716cf692d7123f8c920754 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 22 Jul 2019 00:35:24 +0200 Subject: [PATCH] editor/snippets: don't auto-enable yas-global-mode --- modules/editor/snippets/config.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/editor/snippets/config.el b/modules/editor/snippets/config.el index 5052608d3..4bcc60f25 100644 --- a/modules/editor/snippets/config.el +++ b/modules/editor/snippets/config.el @@ -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))))