From bce32d3ddca4a2e142d234faec09a32e58bdb604 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Thu, 1 Apr 2021 01:32:40 +0200 Subject: [PATCH] Fix yasnippet variables, they need to be set in :init --- .config/emacs/config.org | 3 ++- .config/emacs/snippets/c++-mode/guard | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.config/emacs/config.org b/.config/emacs/config.org index f7e5a5e..4f561d9 100644 --- a/.config/emacs/config.org +++ b/.config/emacs/config.org @@ -634,9 +634,10 @@ Language Server Protocol. #+BEGIN_SRC emacs-lisp (use-package yasnippet :defer t - :config + :init (setq yas-snippet-dirs (list (concat dot-emacs-dir "/snippets"))) (setq yas-prompt-functions '(yas-completing-prompt)) + :config (yas-global-mode)) (use-package yasnippet-snippets diff --git a/.config/emacs/snippets/c++-mode/guard b/.config/emacs/snippets/c++-mode/guard index 0fe300d..a37be0a 100644 --- a/.config/emacs/snippets/c++-mode/guard +++ b/.config/emacs/snippets/c++-mode/guard @@ -3,8 +3,8 @@ # key: grd # -- #ifndef ${1:GUARD}_H -#define ${1:$(yas-c++-class-name yas-text)}_H +#define $1_H $0 -#endif // ${1:$(yas-c++-class-name yas-text)}_H \ No newline at end of file +#endif // $1_H \ No newline at end of file