Last active
July 12, 2019 17:23
-
-
Save bcarlin/5318397 to your computer and use it in GitHub Desktop.
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.
This file contains 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
# [...] | |
function project_aware_subl { | |
project_file=$(ls *.sublime-project 2>/dev/null | head -n 1) | |
command subl ${*:-${project_file:-.}} | |
} | |
alias subl="project_aware_subl" | |
# [...] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Glad it helped you!
I never ran into this issue (also, I'm not using {ba,z}sh for several years now) and I didn't know about
command
.I've updated the gist. Thank you!