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.
This commit is contained in:
parent
2ff762b397
commit
d12e7b831f
1 changed files with 4 additions and 7 deletions
|
@ -21,10 +21,12 @@
|
||||||
:config
|
:config
|
||||||
(setq yas-verbosity (if doom-debug-mode 3 0)
|
(setq yas-verbosity (if doom-debug-mode 3 0)
|
||||||
yas-also-auto-indent-first-line t
|
yas-also-auto-indent-first-line t
|
||||||
yas-triggers-in-field nil ; disallow nested snippets
|
|
||||||
;; Remove default ~/.emacs.d/snippets
|
;; Remove default ~/.emacs.d/snippets
|
||||||
yas-snippet-dirs (delete yas--default-user-snippets-dir yas-snippet-dirs))
|
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
|
;; Allow private snippets in DOOMDIR/snippets
|
||||||
(add-to-list 'yas-snippet-dirs '+snippets-dir nil #'eq)
|
(add-to-list 'yas-snippet-dirs '+snippets-dir nil #'eq)
|
||||||
|
|
||||||
|
@ -63,10 +65,5 @@
|
||||||
[remap yas-visit-snippet-file] #'+snippets/edit))
|
[remap yas-visit-snippet-file] #'+snippets/edit))
|
||||||
|
|
||||||
|
|
||||||
;; `auto-yasnippet'
|
;;;###package auto-yasnippet
|
||||||
(setq aya-persist-snippets-dir (concat doom-etc-dir "auto-snippets/"))
|
(setq aya-persist-snippets-dir (concat doom-etc-dir "auto-snippets/"))
|
||||||
|
|
||||||
|
|
||||||
;; default snippets library
|
|
||||||
(def-package! doom-snippets
|
|
||||||
:after yasnippet)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue