Skip to content

Instantly share code, notes, and snippets.

View trisweb's full-sized avatar
🕶️

Tristan Harward trisweb

🕶️
View GitHub Profile
@trisweb
trisweb / .bashrc
Last active July 12, 2019 15:41 — forked from bcarlin/.bashrc
Alias for sublime text to automatically open a project when calling "subl" if a .sublime-project file is found in the current directory. This alias declaration to put in a bashrc file.
# SublimeText auto-open project in current directory if it exists and argument is . or blank.
function project_aware_subl {
project_file=$(ls *.sublime-project 2>/dev/null | head -n 1)
if [[ ( ! -z "$project_file" ) && ( "${*}" == "." || -z "${*}") ]]
then
command subl "$project_file"
else
command subl ${*}
fi
}