Skip to content

Instantly share code, notes, and snippets.

@bcarlin
Last active July 12, 2019 17:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bcarlin/5318397 to your computer and use it in GitHub Desktop.
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.
# [...]
function project_aware_subl {
project_file=$(ls *.sublime-project 2>/dev/null | head -n 1)
command subl ${*:-${project_file:-.}}
}
alias subl="project_aware_subl"
# [...]
@bcarlin
Copy link
Author

bcarlin commented Jul 12, 2019

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment