Skip to content

Instantly share code, notes, and snippets.

@deanputney
Created April 2, 2015 00:41
Show Gist options
  • Save deanputney/a4019beaa5b245d0c326 to your computer and use it in GitHub Desktop.
Save deanputney/a4019beaa5b245d0c326 to your computer and use it in GitHub Desktop.
subl alias - Prefers project files over opening folders
function subl {
if [ -z "$1" ] || [[ $1 = "." ]]; then
files=$(ls *.sublime-project 2> /dev/null | wc -l)
if [[ $files -eq 0 ]]; then
echo "Opening folder"
/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl .
else
echo "Opening project"
open *.sublime-project
fi
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment