Slippery Snippets
Subverted Snippets
I've decided to put SnippetsEmu on
Google Code, mainly as an excuse to learn a bit more about subversion (and to get into better coding habits). You can find the homepage
here. The SVN trunk at the moment is not really worth checking out as it's just a copy of my current dev directory. I'm going to see if I can recreate the history of the plugin and set tags for the different release versions. The ultimate aim will be to end up with a trunk which can be checked out into your .vim directory so you can get the latest version.
This is just me playing but hopefully it'll become more useful in the future.
Another Sneek Peek
Here's one for the Django developers. I've defined a snippet for use in templates: expand 'scaff',
type the name of your application and model and you'll get the HTML for the form used to edit
the model. (It requires my scaffold.py script from the
Django wiki.)
0.5.6 Released
The new version is available from vim.org. It's a bug fix release which deals with all of the issues identified in the last version.
I've refactored a big chunk of the code so hopefully maintenance should be a little easier from now on.
If you find any bugs in this release then post them in the comments below.
Sneek Peek
I'm working on some bundles for an upcoming release and I'm starting to use a lot commands within tags.
Here's an example of something in the Python Bundle:
pf
expands to:
print "<{s}>" % <{s:ArgList(Count(@z, '%[^%]'))}>
You'll then get an argument list which varies in length depending on the number of placeholders in your print string.
A print string of "The quick, %s %s jumped over %d benches"
will expand to:
print "The quick, %s %s jumped over %d benches" % (<{}>, <{}>, <{}>,)
(Well not really, as the cursor will be sitting on the first empty tag but you get the idea).
The only problem with commands is that they can take up a lot of space but a good choice of function name can help.
0.5.5. Released.
0.5.5 is out. All the bugs mentioned in the last post have been fixed (fingers crossed).
The whole plugin is now a lot more buffer specific and should handle a lot better.
If there are any more bugs (new or old) then post them here (or email me).
0.5.4 Bug list
In the absense of Trac or some other such thing I'll take to posting here. Anyone who has a bug to report can post it in the comments (or I'll update the list if it's been emailed to me).
Here there current list of things to fix:
- s:search_str not defined.
Not having a snippet defined will generate an error when one hits tab - Two commands on same line.
Having two named tags with commands defined one the same line _and_ changing the value of the first tag will fail to change the value of the second - s:search_str not buffer specific.
Having different start and end tags for different file types will break the plugin. The most recent set of tags will be used by all buffers.
If you have any more then stick them in the comments.