Ask HN: Rate my Vim Script: snipMate.vim
1–10 of 13 posts
Re: Ask HN: Rate my Vim Script: snipMate.vim
#2Re: Ask HN: Rate my Vim Script: snipMate.vim
#3How does this compare to snippetsEmu.vim?
Re: Ask HN: Rate my Vim Script: snipMate.vim
#4How does this compare to 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' ;)
Re: Ask HN: Rate my Vim Script: snipMate.vim
#5I'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.
Re: Ask HN: Rate my Vim Script: snipMate.vim
#6Re: Ask HN: Rate my Vim Script: snipMate.vim
#7I'm sorry, how is this different from just having an abbreviation using iab?
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.
Re: Ask HN: Rate my Vim Script: snipMate.vim
#8Re: Ask HN: Rate my Vim Script: snipMate.vim
#9Re: Ask HN: Rate my Vim Script: snipMate.vim
#10I'm sorry, how is this different from just having an abbreviation using iab?
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.