Sublime Forum

Code wrapper plugin - Your opinion please!

#1

I am about to release my first plugin to you. And I hope it will serve you very well.

It will be called WrapIt.
It is a complete rewrite of the SublimeWrapper plugin by lattespirit.

It allows you to easily embed selected code in other code, like a function or loop for example.

As a new feature, you can now define custom wrappers.

Now before publishing the plugin on package-control, I really like to have your input to make it as good as possible right from the start.

In particular, I’d like to know:
1) Do you see a need for this plugin at all, or do you think just working with the standard snippet system already suits your needs well enough?
2) In general, any feature you like me to add,/ change or modify to make WrapIt even more useful to you?
3) On the technical side: Is the way I implemented the wrapper definitions as a kind of pseudo-snippet (see key “template” in the example below) a good one, or should I improve. Should I maybe ditch defining wrappers in the preference file in favor of somehow relying on Sublime’s in-built snippet engine?

Example wrapper definition:

    "definitions":[
                { 
                  "name":"Python",
                  "syntaxes": [
                    "Packages/Python/Python.sublime-syntax",
                    "Packages/Python 3/Python3.tmLanguage",
                    "Packages/Python Improved/PythonImproved.tmLanguage",
                    "Packages/MagicPython/grammars/MagicPython.tmLanguage"
                  ],
                  "wrappers": [
                    {
                      "name": "if / else",
                      "description": "Wrap with: if - else block",
                      "template": "\nif ${1}:\n\t<sel>\nelse:\n\t${2}"
                    }
                  ]
                }
              ]

Find it here: WrapIt

Thank You very much!

  • Ben
1 Like