UltiSnips uses a strategy similar to how Vim detects :h ftplugins
. That is, it will look for the filenames that match the following pattern in your UltiSnips directory: ft.snippets
, ft_*.snippets
, or ft/*
, where ft
is replaced with your Vim filetype (python
, c
, etc.) and *
matches any string including the empty string. A table from :h UltiSnips-how-snippets-are-loaded
:
snippet filename filetype ~
ruby.snippets ruby
perl.snippets perl
c.snippets c
c_my.snippets c
c/a c
c/b.snippets c
all.snippets all
all/a.snippets all
So, to write snippets for the python
filetype, you can use UltiSnips/python.snippets
(or UltiSnips/python_classes.snippets
, or UltiSnips/python/classes.snippets
, for example).
All *.snippet
files use the same syntax, regardless of filetype.