What advantages and/or disadvantages are there to using a \"snippets\" plugin, e.g. snipmate, ultisnips, for VIM as opposed to simply using the builtin \"abbreviations\"
Everything that can be done with snippets can be done with abbreviations and vice-versa. You can have (mirrored or not) placeholders with abbreviations, you can have context-sensitive snippets.
There are two important differences:
while
+ tab. w
+ tab may be enough).There are a few other differences. For instance, abbreviations are always triggered everywhere. And seeing for
expanded into for(placeholder) {\n}
within a comment or a string context is certainly not what the end-user expects. With snippets, this is not a problem any more: we can expect the end-user to know what's he's doing when he asks to expand a snippet. Still, we can propose context-aware snippets that expand throw
into @throw {domain::exception} {explanation}
within a comment, or into throw domain::exception({message});
elsewhere.