yasnippet does not complete snippets that I add to yas/root-directory
(typing the key and hitting tab does not complete).
If I remove .yas-compiled-snippets.el
from an affected directory, then run yas/recompile-all
then yas/reload-all
, I can temporarily use the snippets in that directory. This works for one emacs session, but when I start emacs again, yasnippet again does not recognize the extra snippets.
How can I make the configuration "stick" across runs of emacs?
My yasnippet configuration is like this:
(require 'yasnippet)
(yas/initialize)
(add-hook 'python-mode-hook '(lambda ()
(yas-minor-mode)))
(add-to-list 'yas/root-directory "/path/to/elisp/yasnippet-snippets/")
(add-to-list 'yas/root-directory "/path/to/elisp/yasnippet-extra-snippets/")
yas-snippet-dirs
may answer your question.M-x describe-variable RET yas-snippet-dirs RET
. The variable nameyas/root-directory
is a backwards-compatible alias. "Directory or list of snippet dirs for each major mode. The directory where user-created snippets are to be stored. Can also be a list of directories. In that case, when used for bulk (re)loading of snippets (at startup or via 'yas-reload-all'), directories appearing earlier in the list shadow other dir's snippets. Also, the first directory is taken as the default for storing the user's new snippets." – lawlist Apr 5 '15 at 16:07yas-snippet-dirs
(and also the snippet I tested with has a key that is not used in the snippets that come with yasnippet) – Croad Langshan Apr 5 '15 at 18:51