Browse Source

Fix yasnippet variables, they need to be set in :init

master
Riyyi 4 years ago
parent
commit
bce32d3ddc
  1. 3
      .config/emacs/config.org
  2. 4
      .config/emacs/snippets/c++-mode/guard

3
.config/emacs/config.org

@ -634,9 +634,10 @@ Language Server Protocol.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package yasnippet (use-package yasnippet
:defer t :defer t
:config :init
(setq yas-snippet-dirs (list (concat dot-emacs-dir "/snippets"))) (setq yas-snippet-dirs (list (concat dot-emacs-dir "/snippets")))
(setq yas-prompt-functions '(yas-completing-prompt)) (setq yas-prompt-functions '(yas-completing-prompt))
:config
(yas-global-mode)) (yas-global-mode))
(use-package yasnippet-snippets (use-package yasnippet-snippets

4
.config/emacs/snippets/c++-mode/guard

@ -3,8 +3,8 @@
# key: grd # key: grd
# -- # --
#ifndef ${1:GUARD}_H #ifndef ${1:GUARD}_H
#define ${1:$(yas-c++-class-name yas-text)}_H #define $1_H
$0 $0
#endif // ${1:$(yas-c++-class-name yas-text)}_H #endif // $1_H
Loading…
Cancel
Save