mercredi 24 mars 2010

Vim : from snippets-emu to snipmate, with love.

Being both lazy and a vim user, as I wrote a while ago, I like using
snippets and completion :
http://blog.jardinmagique.info/2009/09/vim-tips-of-day-snippets-autocomplete.html
I've been using Felix Ingram's snippets-emu vim plugin for quite a while
now :
http://www.vim.org/scripts/script.php?script_id=1318
Feature wise, this is an very nice plugin, however the implementation
and snippets obsolescence have slowly been making it less usable despite
my frequent hacking into Django and python snippets.
As of yesterday, I'm now using Michael Sanders's snipmate plugin :
http://www.vim.org/scripts/script.php?script_id=2540
and the additional django specific snippet set from Rob Hudson and Jason
Peddle :
http://github.com/robhudson/snipmate_for_django
While being iso-functional, snipmate provides some nice improvements
over snippets-emu :
- a better user-experience : snippet expansion just works (tm)
- cleaner code expansion : as shown in the screenshot, snippets-emu
snippet expansion outputs some annoying mark tags on error. Snipmate
output is much cleaner, and leave valid, non-blocking code even if you
leave the snippet as-is
- cleaner snippet definition syntax, as shown in the screenshot
- the project is still active
- there are some nice "community" provided sets of snippets
- snipmate is meant to be almost compatible with textmate sets

Thanks again to the authors of these remarkable plugins !