jbrooksuk/InsertNums — pull request #2 by FichteFoll (2013-06-11 21:07:22+00:00)
Title: Basically a complete rewrite (with many more options)

#### A small story on why this PR was created

So, I was in need for a plugin like this and eventually found InsertNums. However, pressing the key bindings opend an input box with the contents `1 1 0` and the cursor at the end. In order to modify this I'd either have to press home (to go to the beginning), then del and then I can start writing. Or delete the whole contents and have to write the last 2 parameters again.
This sucked, so I decided to implement defaults.

But then I looked at the source and found stuff like `return str('%0*d' % (int(padding) + 1, int(current) + counter))` which led to the thought: "Isn't there a better way to do this?".

---

Well, I ended up writing my own format language which included Python's format mini-language because I could let the user just as well specify the formatting himself when I'm using `.format` anyway.

Take a look at the examples in the readme, it's really simple to make it do whatever you like (assuming you read the docs on the formatting). And it was damn easy to add more functionality with the last 2 commits because the regexp system is really easy despite its complexity.

Yes, I'm certainly happy with how this turned out.