From 8785229ecb54e64f9d48611d8cf0925109271e4c Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 4 Aug 2016 16:36:14 +0200 Subject: init: Modularize yasnippet config --- init.d/main.org | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/init.d/main.org b/init.d/main.org index 6ad85a0..ee7eb7d 100644 --- a/init.d/main.org +++ b/init.d/main.org @@ -2738,18 +2738,30 @@ with a custom name and closes it after sending the mail. ** yasnippet -I want to use yasnippets everywhere, so I enable the global mode. In -addition to the default snippets I have some in my personal dir. It +#+begin_src emacs-lisp + (use-package yasnippet + :diminish yas-minor-mode + :config + <>) +#+end_src + +*** Own snippet directory + +In addition to the default snippets I have some in my personal dir. + +#+begin_src emacs-lisp :tangle no :noweb-ref yas + (setq yas-snippet-dirs `("~/.emacs.d/snippets/" + ,yas-installed-snippets-dir)) +#+end_src + +*** Enable global mode + +I want to use yasnippets everywhere, so I enable the global mode. It does not load the all snippets during startup, but only if the first buffer switches to the corresponding mode (only the directories are searched during activation of the global mode). -#+begin_src emacs-lisp - (use-package yasnippet - :config - (setq yas-snippet-dirs `("~/.emacs.d/snippets/" - ,yas-installed-snippets-dir)) - (yas-global-mode 1) - :diminish yas-minor-mode) +#+begin_src emacs-lisp :tangle no :noweb-ref yas + (yas-global-mode 1) #+end_src -- cgit v1.2.3