I am brand new to the realm of snippets in vi[m] and have been doing a little reading here, on Fandom, and the repos on github. I notice that vim-snippets has been mentioned a few times in terms of being the "go to" source, at least for the snipmate family.

Along the way, I happened to run across a mention of Bitbucket Snippets. I was wondering how popular that was in terms of maintaining a personal or team repo, and whether any of the popular plugins has or is planning on integrating with it (or, conversely, has a firm reason against doing so). My thinking is that there would be a fairly large demand for being able to curate more-or-less proprietary (or idiosyncratic anyway) collections of snippets.

  • Most snippets plugins allow you to create your own... should be a simple matter of git clone or equivalent for a central repository... however, bitbucket snippets seems a different thing (more like team-shareable gists, if you’re familiar with github). – D. Ben Knoble May 7 at 0:20

I think you're mixing up two different and not directly related kinds of snippets here...

Vim snippets are templates you can use while editing text and are meant to help you fill up a lot of the boilerplate you need in many programming languages. For instance, you can use snippets to quickly insert skeletons of classes or functions, a template for a main function, setters and getters for attributes, or even blocks for if, while, switch statements for languages.

Vim snippets typically allow (or even require) customization when used, either through fields that are filled in (such as function or class name to use when creating a function or class through a snippet, or a variable to use and upper limit when creating a for loop), or by being put inside a code block after expanding the snippet.

Bitbucket snippets, on the other hand, are simply a somewhat unstructured repository for sharing contents, logs, pastes or media files with others (or saving them for later.) Bitbucket happens to be using a git repository to implement storage and versioning for those snippets.

That's very similar to GitHub's Gists.

It also fills a similar role to many Paste Bin services you'll find online.

You could use Bitbucket Snippets to store Vim snippets, but Vim snippet managers typically want something more structured, like an actual git repository, so using a real repository (such as honza/vim-snippets) is usually more appropriate than less structured forms.

If what you're after is a Vim plug-in to help you manage, publish and fetch to paste bin types of services, you'll likely find many of those too. For example, consider mattn/vim-gist to integrate with GitHub's Gists (which, as mentioned above, seem to be very similar to what Bitbucket implemented on their Snippets.)

| improve this answer | |
  • 1
    Thanks for your insight. Looks like I will have to wade into this more deeply to clarify my understanding and ultimate objectives.... – Jeff May 12 at 18:48

Your Answer

