Skip to content

Commit

Permalink
Update 'tm' function to take multiple files on the command-line
Browse files Browse the repository at this point in the history
  • Loading branch information
MattLewin committed Mar 25, 2016
1 parent 9280f2c commit fc89773
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions plugins/textmate/textmate.plugin.zsh
@@ -1,13 +1,14 @@
# If the tm command is called without an argument, open TextMate in the current directory
# If tm is passed a directory, cd to it and open it in TextMate
# If tm is passed a file, open it in TextMate
# If tm is passed anything else (i.e., a list of files and/or options), pass them all along
# This allows easy opening of multiple files.
function tm() {
if [[ -z $1 ]]; then
mate .
else
elif [[ -d $1 ]]; then
mate $1
if [[ -d $1 ]]; then
cd $1
fi
cd $1
else
mate "$@"
fi
}

0 comments on commit fc89773

Please sign in to comment.