summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2016-03-30 04:29:56 +0200
committerMarc Cornellà <marc.cornella@live.com>2016-03-30 04:29:56 +0200
commitd1a5fad25b4e1ed008844efd055c1f33d6d5f633 (patch)
tree1f520369552078c820ef37172527d4a18c9afd84 /plugins
parentdfccac312c3093f32ce18c030846255602698597 (diff)
parentfc897734138475ac3a6548b856ddf4741ef40c07 (diff)
downloadzsh-d1a5fad25b4e1ed008844efd055c1f33d6d5f633.tar.gz
zsh-d1a5fad25b4e1ed008844efd055c1f33d6d5f633.tar.bz2
zsh-d1a5fad25b4e1ed008844efd055c1f33d6d5f633.zip
Merge pull request #4943 from MattLewin/master
Update 'tm' function to take multiple files on the command-line
Diffstat (limited to 'plugins')
-rw-r--r--plugins/textmate/textmate.plugin.zsh11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/textmate/textmate.plugin.zsh b/plugins/textmate/textmate.plugin.zsh
index 02813de9e..174511019 100644
--- a/plugins/textmate/textmate.plugin.zsh
+++ b/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
}