Created
November 25, 2017 05:25
-
-
Save xtream1101/d54c6edd810ff900d824c6d6a793031a to your computer and use it in GitHub Desktop.
Auto create and open sublime projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sublime_project_template='{ | |
"folders": | |
[ | |
{ | |
"path": "." | |
} | |
], | |
"file_exclude_patterns":[ | |
"*.sublime-*" | |
] | |
} | |
' | |
sub(){ | |
dir_name=${PWD##*/} | |
if [[ ! -e "${dir_name}.sublime-project" ]]; then | |
# Create sublime project file | |
echo "Creating new project using current directory" | |
echo $sublime_project_template > ${dir_name}.sublime-project | |
fi | |
# Open | |
sublime --project ${dir_name}.sublime-project | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment