Prioritize private snippets over built-in ones
In the case of snippet conflicts, you'd normally be prompted to select which snippet you want. Built-in snippets are now disregarded if conflicting private ones exist. This makes it easier for users to add overriding snippets to DOOMDIR/snippets.
This commit is contained in:
parent
735e14270e
commit
1490b9ec8d
2 changed files with 22 additions and 4 deletions
|
@ -22,11 +22,17 @@
|
|||
:config
|
||||
(setq yas-verbosity (if doom-debug-mode 3 0)
|
||||
yas-also-auto-indent-first-line t
|
||||
yas-prompt-functions (delq #'yas-dropdown-prompt yas-prompt-functions)
|
||||
yas-triggers-in-field t) ; Allow nested snippets
|
||||
|
||||
;; Allow private snippets in DOOMDIR/snippets
|
||||
(add-to-list 'yas-snippet-dirs '+snippets-dir nil #'eq)
|
||||
|
||||
;; Remove GUI dropdown prompt (prefer ivy/helm)
|
||||
(delq #'yas-dropdown-prompt yas-prompt-functions)
|
||||
;; Prioritize private snippets in `+snippets-dir' over built-in ones if there
|
||||
;; are multiple choices.
|
||||
(add-to-list 'yas-prompt-functions #'+snippets-prompt-private nil #'eq)
|
||||
|
||||
;; Register `def-project-mode!' modes with yasnippet. This enables project
|
||||
;; specific snippet libraries (e.g. for Laravel, React or Jekyll projects).
|
||||
(add-hook 'doom-project-hook #'+snippets|enable-project-modes)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue