liamcain / SMART-Snippets

A Sublime Text plugin for creating smart, dynamic snippets
46 stars 7 forks source link

SMART Snippets

Important

SMART Snippets is still early in development. There is A LOT left to do. At the moment, however, it is both functional and bugfree. This is exciting because now I can finally think seriously about where I see this plugin going in the future.

SMART Snippets is a new Sublime Text plugin that aims to enhance your overall coding experience. With SMART Snippets, You can now use Python to dynamically create snippets. Need to quickly timestamp your code? Unfortunately, ST2's default snippets are static. So you could spend your time trudging through Sublime Text's API, wasting precious hours to do something so trivial... but that shouldn't be your job. You have your own work to do. Instead, let SMART Snippets handle it. Not only does this plugin let you execute Python code within a snippet, it provides a simpler syntax for gettings things done.

Getting Started

SMART Snippets comes pre-bundled with a few snippets to get you started and demonstrate some of the syntax as well as show of the power you now hold. To create your own, open the Command Palette and type SMART Snippets: Create new SMART Snippet. The template will guide you from there. IMPORTANT: the snippet must be saved within the SMART Snippet folder. It can be in a subfolder, though, so feel free to organize by language or any other preference. SMART Snippets makes snippet management as easy and painless as possible. To view a list of all your snippets, type SMART Snippets: List SMART Snippets into the Command Palette. Selecting the first item from list list will show only the snippets that match the current scope. Selecting a snippet from the quick panel will open the corresponding snippet file.

Options within the Snippet template:

What To Do From There

SMART Snippets is meant to be the missing link between the average user and the ST2 API while bringing more fluidity to the power user. On that note, here are the available commands so far:

SMART Snippet's Custom Syntax

The following is a list of functions and additions to the python insertions available at your disposal.

Not a Pythonista?

Don't fret. Not only is Python insanely simple and readable, SMART Snippets keeps everything you need within reach. With direct access to Python libraries and the Sublime Text API, you'll be manipulating your code ease.

License

Copyright (c) 2012 William Cain

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.