2

In .emacs, I bound the key for yasnippet as,

(define-key yas-minor-mode-map (kbd "C-SPC") 'yas-expand)

In a buffer with python as major mode and yasnippet, autocomplete as minor mode, yasnippet doesn't expand on C-SPC.

Now, i started doubting if there are any snippets available. I did C-c & C-v (or) Visit Snippet File and it gives alarm, No snippet tables active.

How to add snippets to a major mode?

Madhavan
  • 1,957
  • 12
  • 28
  • Have a look at "The Condition System" over here: http://capitaomorte.github.io/yasnippet/snippet-expansion.html Is that maybe what you need? – Brian Z Apr 21 '15 at 07:18
  • Using "C-SPC" works for me. Did you try expanding other snippets? Maybe type "fd" and see if it expands to a function with a docstring. I think a "class" snippet just doesn't exist, I think it's "cls" instead. – bmag Apr 21 '15 at 08:37

1 Answers1

1

Looks like, yas-snippets doesn't get loaded by default. Calling yas-reload-all loaded the python snippets. I confirmed, the snippets are loaded by listing them with C-c & C-v. And it works now...

Madhavan
  • 1,957
  • 12
  • 28