I use textmate for website development and compass to compile css stylesheets. Right now everytime I open up the folder with textmate I have to additionally run a compass watch /path/to/folder command. I know textmate is pretty powerfull, but not sure how to make it work so the compass watch command is automatically applied to projects you open with textmate (I usually drag the projectfolder on the dock-icon). Is this possible?
I use textmate for website development and compass to compile css stylesheets. Right now
Share
Sure thing. You will need to make a small function in your .bashrc file.
I based the function below off an alias I create for SublimeText2 to make it work like “
mate dir/” (a feature I missed greatly):So, you don’t really want an alias to run two commands, since an alias is…an “alias” for a specific command. However, a function is well suited:
I picked “matew” – cause it was like mate+watch, but you can call your function whatever you will remember. (e.g
epicPwn(), etc) Thus, your new function is run as:Note: Just be sure to put the correct path to TextMate. Also, the
compass watchcommand will fowl up if you aren’t passing a directory, obviously. Similarly if the directory doesn’t have a compass project ->compass watchwill spit back a standard “no project” error (but TM will still open the dir/). e.g.: