Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YASnippet isn't loaded for CSS/SCSS modes and can't find .emacs.d/private/snippets dir #532

Closed
ashervb opened this issue Feb 3, 2015 · 1 comment
Labels

Comments

@ashervb
Copy link
Contributor

ashervb commented Feb 3, 2015

Opening a CSS or SCSS file doesn't enable YaSnippet mode.

In my attempt to load them, I performed M-x yas-global-mode. This causes emacs to attempt to load from .emacs.d/snippets rather than the .emacs.d/private/snippets dir. Putting snippets in the former dir allows them to be loaded. Not sure if these issues are related. Note that it DOES find .emacs.d/private/snippets on non CSS/SCSS files.

@jcpetkovich
Copy link
Contributor

That's because the hook that sets up spacemacs's yasnippet snippets is only added to certain parent modes:

(add-to-hooks 'spacemacs/load-yasnippet '(prog-mode-hook
                                          markdown-mode-hook
                                          org-mode-hook))

css-mode and scss mode do not inherit from any of the above top-level mode classes. They both are derived from fundamental-mode, so the hook should probably be added to them individually. I have also noticed that snippets aren't loaded for latex mode sometimes, since it derives from text-mode.

jcpetkovich added a commit to jcpetkovich/spacemacs that referenced this issue Feb 10, 2015
This fixes syl20bnr#532 by adding spacemacs/load-yasnippet to the css-mode-hook.
This fixes both css-mode and scss-mode.
jcpetkovich added a commit to jcpetkovich/spacemacs that referenced this issue Feb 11, 2015
This fixes syl20bnr#532 by adding spacemacs/load-yasnippet to the css-mode-hook.
This fixes both css-mode and scss-mode.

Switch to init-yasnippet for calling load-yasnippet
vijaykiran pushed a commit to vijaykiran/spacemacs that referenced this issue Mar 17, 2015
This fixes syl20bnr#532 by adding spacemacs/load-yasnippet to the css-mode-hook.
This fixes both css-mode and scss-mode.

Switch to init-yasnippet for calling load-yasnippet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants