summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--emacs/custom/my-settings.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/emacs/custom/my-settings.el b/emacs/custom/my-settings.el
index 8062216..5ff81d1 100644
--- a/emacs/custom/my-settings.el
+++ b/emacs/custom/my-settings.el
@@ -62,11 +62,18 @@
   (add-hook 'emacs-startup-hook (lambda () (exec-path-from-shell-initialize))))
 
 (require 'yasnippet)
+
 ;; I want the snippets under `etc'
-(setq yas-snippet-dirs (expand-file-name "etc/snippets" user-emacs-directory))
+(defvar my/yasnippets (expand-file-name "etc/snippets" user-emacs-directory))
+
+(if (and  (file-exists-p my/yasnippets) (not (member my/yasnippets yas-snippet-dirs)))
+    (add-to-list 'yas-snippet-dirs my/yasnippets))
+
 ;; the default (tab) conflicts with corfu for completion
 (define-key yas-minor-mode-map (kbd "C-c y") #'yas-expand)
 
+(yas-global-mode 1)
+
 (provide 'my-settings)
 
 ;;; my-settings.el ends here