Skip to content

Instantly share code, notes, and snippets.

@olls
Last active August 29, 2015 14:26
Show Gist options
  • Save olls/55cdf3f03f763d261451 to your computer and use it in GitHub Desktop.
Save olls/55cdf3f03f763d261451 to your computer and use it in GitHub Desktop.
Project Initialiser
function pro
set name $argv[1]
mkdir $name
if test $status = 0
cd $name
git init
printf (echo $name | sed -e 's/^./\U&/' | tr _ ' ' | tr '-' ' ')\n(head -c (expr length + $name) < /dev/zero | tr '\0' '=')\n > README.md
set subl_dir /home/olls/.config/sublime-text-3
cp $subl_dir/default.sublime-project $name.sublime-project
# Add project to library.json
set temp tmp-lib.json
head -n1 $subl_dir/Packages/User/Projects/library.json >> $temp
printf \t\"(pwd)/$name.sublime-project\",\n >> $temp
tail -n +2 $subl_dir/Packages/User/Projects/library.json >> $temp
mv $temp $subl_dir/Packages/User/Projects/library.json
subl --project $name.sublime-project
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment