Skip to main content
1 of 2
Hubisan
  • 1.7k
  • 9
  • 11

You need to put the snippet into a folder with the name of the mode to use it in as follows:

snippets/org-mode/diary_template

Check out the documentation:

Organizing snippets > Basic structure:

.
|-- c-mode
|   `-- printf
|-- java-mode
|   `-- println
`-- text-mode
    |-- email
    `-- time

Expanding snippets > ... > Eligible snippets :

YASnippet does quite a bit of filtering to find out which snippets are eligible for expanding at the current cursor position.

In particular, the following things matter:

  • Currently loaded snippets tables

These are loaded from a directory hierarchy in your file system. See Organizing Snippets. They are named after major modes like html-mode, ruby-mode, etc…

  • Major mode of the current buffer

If the currrent major mode matches one of the loaded snippet tables, then all that table's snippets are considered for expansion. Use M-x describe-variable RET major-mode RET to find out which major mode you are in currently.

...

Hubisan
  • 1.7k
  • 9
  • 11