Using bash script on Sublime Text 2

By using Shell-Turtlestein and snippet, you can use bash script on Sublime Text 2 to assist us creating a project.

Here you can find how to do it with Alfred. Please have a look at the video. But I will show you here how to do it within Sublime Text 2. I tested it with Mac. But it should work in Windows with little code changes.

First you create a Template directory and add necessary folder and files except backbone, jquery etc.


Now you need to install Shell-Turtlestein through Package Control. Shift+Command+p to open Package Control and type ‘install’. Then type Turtlestein to find Shell-Turtlestein to install.

You need to create a snippet in Sublime Text 2. Goto Tools>New Snippet and enter the following and save as backbone.sublime-snippet(create a folder shell under ~/Library/Application Support/Sublime Text 2/Packages/User/shell/backbone.sublime-snippet).

	cp -R ~/Templates/Backbone/ . ; curl > assets/js/libs/backbone.js ; curl > assets/js/libs/underscore.js ; curl > assets/js/libs/jquery.js ; /Applications/Sublime\ Text\ .
	<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
	<!-- Optional: Set a scope to limit where the snippet will trigger -->

Now all are ready to execute it. Create a folder and a file called index.php in Sublime. Then Shift+Command+c to open a Shell-Turtlestein console. Type bb +tab to display commands, then enter to run it.

You should have backbone-min.js, underscore-min.js and jquery.js under js folder and all other folders and files you created under ~/Template folder.

2 comments to Using bash script on Sublime Text 2

Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>