From d12e7b831f7843968dc9c8d9457c174526f3c4ea Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 14 Jul 2019 22:46:16 +0200 Subject: [PATCH] editor/snippets: load doom-snippets sooner We want +snippets-dir to be first in yas-snippet-dirs. To ensure this, doom-snippets should be loaded immediately before it is added to it, if possible. --- modules/editor/snippets/config.el | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/editor/snippets/config.el b/modules/editor/snippets/config.el index 941a5030f..5052608d3 100644 --- a/modules/editor/snippets/config.el +++ b/modules/editor/snippets/config.el @@ -21,10 +21,12 @@ :config (setq yas-verbosity (if doom-debug-mode 3 0) yas-also-auto-indent-first-line t - yas-triggers-in-field nil ; disallow nested snippets ;; Remove default ~/.emacs.d/snippets yas-snippet-dirs (delete yas--default-user-snippets-dir yas-snippet-dirs)) + ;; default snippets library, if available + (require 'doom-snippets nil t) + ;; Allow private snippets in DOOMDIR/snippets (add-to-list 'yas-snippet-dirs '+snippets-dir nil #'eq) @@ -63,10 +65,5 @@ [remap yas-visit-snippet-file] #'+snippets/edit)) -;; `auto-yasnippet' +;;;###package auto-yasnippet (setq aya-persist-snippets-dir (concat doom-etc-dir "auto-snippets/")) - - -;; default snippets library -(def-package! doom-snippets - :after yasnippet)