

Ask HN: Rate my Vim Script: snipMate.vim - meese_
http://www.vim.org/scripts/script.php?script_id=2540

======
mileszs
Unfortunately, it seems to clash loudly with one of the Ruby or Rails plugins
I use (most likely rails.vim, and its RAbbrevs). Being admittedly fairly
ignorant when it comes to vimscript, as well as being impatient, I removed
snipMate for now. If you have a quick solution for such woes, I'd love to try
it.

I'd be willing to maintain a fork on GitHub that avoids clashing with
rails.vim (or whatever the issue is), if we can figure it out. Maybe I'll
actually properly learn vimscript as a result.

~~~
meese_
I think I've fixed this, can you try the latest release and see if you
encounter the same problems?

~~~
mileszs
Yes, this seems to be fixed. Thanks!

I can't yet report on how useful it is, because I haven't used it for more
than 60 seconds yet, but it looks good. I'm looking forward to using it.

------
aditya
I'm sorry, how is this different from just having an abbreviation using iab?

~~~
Harkins
Abbreviations expand into a single output. TextMate Snippets expand that
output and then make it trivial to move between the parts you'll want to
customize.

So a 'for' abbreviation would output: for (;;) { } and leave the cursor after
the }.

A 'for' snippet would output the same thing, but you could bounce on the tab
key to move between the three parameters to for, the body of the loop, and the
line after the loop.

~~~
etal
vim-latexsuite does something similar for creating environments. The default
is Ctrl-J for jumping to the next section that needs to be filled in. The
procedure takes some getting used to; I didn't like it at first.

------
kurczak
Can't get it to work. Using gvim on winxp. Directories are okay, nocompatibile
is enabled, using expandtab + softtabstop=4 - but the only thing I get after
pressing <tab> after one of the snippet keywords is a single space.

------
tdavis
Other than being unable to get the html snippets to work, I like it and will
be trying it as a SnippetsEMU replacement (if I can get html files working).

------
nadim
How does this compare to snippetsEmu.vim?

~~~
meese_
The features listed on that page are not, to my knowledge, supported on
snippetsEmu.vim:

"- The syntax of snippets is very similar to TextMate's, allowing easy
conversion.

\- The position of the snippet is kept transparently (i.e. it does not use
marks/placeholders inserted in the buffer), which allows you to escape out of
an incomplete snippet, something particularly useful in Vim.

\- Variables in snippets are updated as-you-type

\- Snippets can have multiple matches

\- Snippets can be out of order. For instance, in a do...while loop, the
condition can be added before the code."

There are also more snippets for more filetypes enabled by default with
snipMate.vim, partly because of the features it supports. I also managed to
get it to around half the code, which pleases me but I doubt anyone else would
consider it a 'feature' ;)

------
jonasb
I've given it a spin, and must say that I like it a lot. Thanks a lot meese_!

