Home Download Buy Blog Forum Support

Add sidebar right click commands ... (LiveReload and SASS)

Add sidebar right click commands ... (LiveReload and SASS)

Postby firefusion on Wed Jul 13, 2011 8:59 am

I want to add some sidebar right click commands that launch CMD and pass it a variable from the selected file name or path. Specifically i want....

1. A right click on .scss files that launches Ruby in CMD.exe and watches the selected file.
2. A right click on folders to that launches Ruby in CMD.exe and the selected folder path and runs livereload.

How would I go about doing this?

Here are the commands I'd use for the windows registry to add them to the explorer right click...

1. cmd.exe /E:ON /K C:\Ruby192\bin\setrbvars.bat && sass --watch "%1"
2. cmd.exe /E:ON /K C:\Ruby192\bin\setrbvars.bat && pushd %L && livereload

For those who don't know what livereload and SASS are they're awesome for web development.
firefusion
 
Posts: 218
Joined: Fri Oct 16, 2009 7:37 am

Re: Add sidebar right click commands ... (LiveReload and SASS)

Postby jps on Wed Jul 13, 2011 2:11 pm

You'll have to make a plugin to launch cmd.exe. You can take a look at Default/exec.py for an example, but it's likely doing a lot more work than what you need it to.

To get an entry for the plugin on the sidebar context menu, you can create a Context.sublime-menu file in your package. Take a look at the 'Diff' package that ships with Sublime Text 2 for an example of this.
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm


Return to General Discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 27 guests