Created
January 9, 2014 16:37
-
-
Save dagolden/8337300 to your computer and use it in GitHub Desktop.
improved tmux hack command
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
hack () { | |
local dir=$(find ~/git '(' '(' -name .git -or -name .build ')' -prune -false ')' -or -iname $1 -type d) | |
if [[ -n $dir && -d $dir ]]; then | |
tmux new-window -c $dir -n $(basename $dir) | |
elif [[ -n $dir ]]; then | |
local count=$(echo $dir | wc -w) | |
echo $1 ambiguous: $count matches | |
else | |
echo "$1 not found" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment