The Yasnippet documentation explains that you will need to include a .yas-parents
file with the parent modes:
It's very useful to have certain modes share snippets between themselves. To do this, choose a mode subdirectory and place a .yas-parents
containing a whitespace-separated list of other mode names. When you reload those modes become parents of the original mode.
.
|-- c-mode
| |-- .yas-parents # contains "cc-mode text-mode"
| `-- printf
|-- cc-mode
| |-- for
| `-- while
|-- java-mode
| |-- .yas-parents # contains "cc-mode text-mode"
| `-- println
`-- text-mode
|-- email
`-- time
Hence, you could, for example, put your snippet in a text-mode
directory, and then, in the latex-mode
and org-mode
directories, include a .yas-parents
file that include the text text-mode
.