Created
September 2, 2015 13:37
-
-
Save fordhurley/6de343de9b39acefdfd4 to your computer and use it in GitHub Desktop.
Easily open the current directory in sublime. Place in your aliases file or .bashrc.
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 Text launcher, which does special stuff if you pass no arguments. If a | |
# ".sublime-project" file is found in the current dir, it opens that. Otherwise, | |
# it opens ".". | |
function subl() { | |
local args=$@ | |
if [[ $# -lt 1 ]]; then | |
args="$(find . -maxdepth 1 -name '*.sublime-project' -print -quit)" | |
fi | |
if [[ -z "$args" ]]; then | |
args="." | |
fi | |
>&2 echo /usr/local/bin/subl "$args" | |
/usr/local/bin/subl "$args" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment