From 85e6312355cfb8a0f1774a05b1e671bc89a97235 Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Mon, 7 Nov 2022 09:56:19 +0800 Subject: Add emacs snippet config --- .emacs.d/init.el | 1 + .emacs.d/lisp/init-snippet.el | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 .emacs.d/lisp/init-snippet.el (limited to '.emacs.d') diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 9f87d7c..f400fc8 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -40,6 +40,7 @@ (require 'init-terminal) (require 'init-misc) (require 'init-godot) +(require 'init-snippet) (require 'init-appearance) (add-hook 'after-init-hook diff --git a/.emacs.d/lisp/init-snippet.el b/.emacs.d/lisp/init-snippet.el new file mode 100644 index 0000000..5c6609a --- /dev/null +++ b/.emacs.d/lisp/init-snippet.el @@ -0,0 +1,12 @@ +(setq yas-snippet-dirs + '("~/.emacs.d/snippets" + "~/.emacs.d/local/snippets")) + +(when (gx/maybe-require-package 'yasnippet) + (gx/maybe-require-package 'yasnippet-snippets) + (require 'yasnippet) + (yas-reload-all) + (add-hook 'prog-mode-hook #'yas-minor-mode) + (add-hook 'org-mode-hook #'yas-minor-mode)) + +(provide 'init-snippet) -- cgit v1.2.3