summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Lewin <matt@lewin.us>2016-03-25 11:57:09 -0700
committerMatthew Lewin <matt@lewin.us>2016-03-25 11:57:09 -0700
commitfc897734138475ac3a6548b856ddf4741ef40c07 (patch)
tree7fd64a4debfa95bf03ffb0f46fe4220d69c7c5ff /plugins
parent9280f2c874b1126ee9399c353d1e0184fd39b4e4 (diff)
downloadzsh-fc897734138475ac3a6548b856ddf4741ef40c07.tar.gz
zsh-fc897734138475ac3a6548b856ddf4741ef40c07.tar.bz2
zsh-fc897734138475ac3a6548b856ddf4741ef40c07.zip
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
}