I've been using ultisnips for several
I think the main advantages of this plugins are the following:
- It is pretty fast even with a great number of snippets available.
- The basic syntax to define a new snippet is easy to understand, thus it is
easy to create quickly a new snippet doing what you want to do. (For more
complex snippets some additional work can be required)
- It works very well out of the box, a basic configuration allow you do use
snippets very quickly.
- It is really configurable. Even if the basic configuration works well, if
you're a power user you can really tune it pretty finely.
First of all ultisnips is a snippet engine which means that the plugin provides
features to use snippets but doesn't provide the snippets themselves. To get the
snippets, the author recommends to use
Once you got both plugin installed you'll be able to use your snippets.
The snippets definition are stored in files named following patterns:
ft is the 'filetype' of the
current document and
* is a shell-like wildcard matching any string including
the empty string. (Note that dotted filetype syntax like
This way snippets specifics to a filetype are expanded only when the buffer's
filetype is set. A special filetype
all is available to create snippets
expanded on every buffers.
In addition to the snippets provided by vim-snippets, the user can define it's
own snippets. My recommendation would be to place them in the directory
~/.vim/my-snippets/Ultisnips this way Ultisnips will find them without
additional configuration and it is easy to maintain them in a dotfile
To expand the snippets Ultisnips provides a variable
which defines the mapping which will trigger the expansion (I choose
** which is pretty convenient for me). Note that an integration
should be possible but I didn't tested it by myself).
For power users, Ultisnips also provides some function to customize the behavior
of the expansion, or to trigger it differently. See
This is the first snippet manager that I really use extensively and I think this
is a good one to begin with for its simplicity out of the box and its
possibility to be tuned.
Finally here is a list of screencast which give a good introduction to the