Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. # SublimeText auto-open project in current directory if it exists and argument is . or blank.
  2. function project_aware_subl {
  3. project_file=$(ls *.sublime-project 2>/dev/null | head -n 1)
  4. if [[ ( ! -z "$project_file" ) && ( "${*}" == "." || -z "${*}") ]]
  5. then
  6. command subl "$project_file"
  7. else
  8. command subl ${*}
  9. fi
  10. }
  11. alias subl="project_aware_subl"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement