The One Way[tm] way to release ultisnip snippet bundles?

Asked by Bèr Kessels (berkes)

What is the best way to release UltiSnip snippet bundles? I am preparing some for Drupal, as my various Drupal projects roll along. They will be on my github as such (and possibly on drupal.org too).

I have read up on the several configuration options to include other directories and have Ultisnip walk trough the tree hierarchy, but I am lost.

My wishes:
* People should be able to drop my set of snippets in their pathogen "~/.vim/bundle", with either git clone or by manually unpacking it.
* People without pathogen should be able to unpack these snippets as a subdirectory somewhere. Anywhere where UltiSnip can pick them up, actually.
* People should not need to update their vimrc or other config options to have UltiSnip pick up the new snippets.

Is that possible? Where would I place the new bundle?

Note that I /do/ assume that filetypes such as "drupal", "drupaltheme", "drupalini" etc are already recognised by their vim env. (I might even ship an ftplugin with the snippet bundle for that, in future).

Question information

Language:
English Edit question
Status:
Solved
For:
UltiSnips Edit question
Assignee:
No assignee Edit question
Solved by:
SirVer
Solved:
Last query:
Last reply:
Revision history for this message
Best SirVer (sirver) said :
#1

I never thought about this. I assumed people would contribute snippet bundles to UltiSnips - so we would just ship them out with UltiSnips. But having them in a bundle with others makes sense as well.

the pathogen case should be handled: pathogen adds all bundels to the runtimepath, so UltiSnips should find snippets assuming users have not changed UltiSnipsSnippetDirectories. Same goes for ~/.vim/Ultisnips/<drupal>/*.snippets. Have you tried this?

Revision history for this message
Bèr Kessels (berkes) (ber) said :
#2

~/.vim/Ultisnips/<drupal>/*.snippets is be good for people manually installing. I can confirm this works.
I will make a note for pathogen users who have changed UltiSnipsSnippetDirectories.

That solves it for me. Thanks a lot!

The main case where I can see people shipping ultisnip bundles separate from the main ultisnip bundle is when they come shipped on a projectbase; offering all sorts of plugins, settings, and snippets for a single environment or system. Like Drupal. Or Django, Rails etceteras.